-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.cirrus.yml
149 lines (144 loc) · 5.97 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
env:
PATH: "$HOME/.cargo/bin:$PATH"
RUST_VERSION: '1.79.0' # Needs to be <= FreeBSD quarterly version
AWS_ACCESS_KEY_ID: ENCRYPTED[44da4d040f7e219d5394590e9d8e3d684605a50603bfbf50c27a7f1fc1eba7448f09294b75945db653debbbe22f26d26]
AWS_SECRET_ACCESS_KEY: ENCRYPTED[216986009641f20db5d35fa6df20de4f4f9bdba934494b6ebe6d50661a559930624a4d79d2a871aa49b6420336eb4cd1]
task:
name: Build (Debian x86_64)
container:
image: debian:12-slim
cpu: 4
cargo_cache:
folder: $HOME/.cargo/registry
fingerprint_script: cat Cargo.lock
install_script:
- apt-get update && apt-get install -y --no-install-recommends git ca-certificates curl gcc libc6-dev musl-tools
- curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain ${RUST_VERSION}
- rustup target add x86_64-unknown-linux-musl
- mkdir ~/bin
- curl -L https://releases.wezm.net/upload-to-s3/0.3.0/upload-to-s3-0.3.0-x86_64-unknown-linux-musl.tar.gz | tar xzf - -C ~/bin
test_script:
- cargo test
publish_script: |
tag=$(git describe --exact-match HEAD 2>/dev/null || true)
if [ -n "$tag" ]; then
cargo build --release --locked --target x86_64-unknown-linux-musl
tarball="feedlynx-${tag}-x86_64-unknown-linux-musl.tar.gz"
strip target/x86_64-unknown-linux-musl/release/feedlynx
tar zcf "$tarball" -C target/x86_64-unknown-linux-musl/release feedlynx
~/bin/upload-to-s3 -b releases.wezm.net "$tarball" "feedlynx/$tag/$tarball"
fi
task:
name: Build (Debian aarch64)
arm_container:
image: debian:12-slim
cpu: 4
cargo_cache:
folder: $HOME/.cargo/registry
fingerprint_script: cat Cargo.lock
install_script:
- apt-get update && apt-get install -y --no-install-recommends git ca-certificates curl gcc libc6-dev musl-tools
- curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain ${RUST_VERSION}
- rustup target add aarch64-unknown-linux-musl
- mkdir ~/bin
- curl -L https://releases.wezm.net/upload-to-s3/0.3.0/upload-to-s3-0.3.0-aarch64-unknown-linux-musl.tar.gz | tar xzf - -C ~/bin
test_script:
- cargo test
publish_script: |
tag=$(git describe --exact-match HEAD 2>/dev/null || true)
if [ -n "$tag" ]; then
cargo build --release --locked --target aarch64-unknown-linux-musl
tarball="feedlynx-${tag}-aarch64-unknown-linux-musl.tar.gz"
strip target/aarch64-unknown-linux-musl/release/feedlynx
tar zcf "$tarball" -C target/aarch64-unknown-linux-musl/release feedlynx
~/bin/upload-to-s3 -b releases.wezm.net "$tarball" "feedlynx/$tag/$tarball"
fi
task:
name: Build (FreeBSD)
freebsd_instance:
image_family: freebsd-13-3
cpu: 4
cargo_cache:
folder: $HOME/.cargo/registry
fingerprint_script: cat Cargo.lock
install_script:
- pkg install -y git-lite rust ca_root_nss
- fetch -o - https://releases.wezm.net/upload-to-s3/0.3.0/upload-to-s3-0.3.0-amd64-unknown-freebsd.tar.gz | tar xzf - -C /usr/local/bin
test_script:
- cargo test
publish_script: |
tag=$(git describe --exact-match HEAD 2>/dev/null || true)
if [ -n "$tag" ]; then
cargo build --release --locked
tarball="feedlynx-${tag}-amd64-unknown-freebsd.tar.gz"
strip target/release/feedlynx
tar zcf "$tarball" -C target/release feedlynx
upload-to-s3 -b releases.wezm.net "$tarball" "feedlynx/$tag/$tarball"
fi
task:
name: Build (Mac OS)
macos_instance:
image: ghcr.io/cirruslabs/macos-runner:sonoma
env:
PATH: "$HOME/.cargo/bin:$HOME/bin:$PATH"
cargo_cache:
folder: $HOME/.cargo/registry
fingerprint_script: cat Cargo.lock
install_script:
- curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain ${RUST_VERSION}
- mkdir ~/bin
- curl -L https://releases.wezm.net/upload-to-s3/0.3.0/upload-to-s3-0.3.0-universal-apple-darwin.tar.gz | tar xzf - -C ~/bin
- rustup target add x86_64-apple-darwin
test_script:
- cargo test
publish_script: |
tag=$(git describe --exact-match HEAD 2>/dev/null || true)
if [ -n "$tag" ]; then
cargo build --release --locked
cargo build --release --locked --target x86_64-apple-darwin
mv target/release/feedlynx target/release/feedlynx.$CIRRUS_ARCH
lipo target/release/feedlynx.$CIRRUS_ARCH target/x86_64-apple-darwin/release/feedlynx -create -output target/release/feedlynx
lipo -info target/release/feedlynx
tarball="feedlynx-${tag}-universal-apple-darwin.tar.gz"
strip target/release/feedlynx
tar zcf "$tarball" -C target/release feedlynx
upload-to-s3 -b releases.wezm.net "$tarball" "feedlynx/$tag/$tarball"
fi
task:
name: Build (Windows)
windows_container:
image: cirrusci/windowsservercore:cmake
cpu: 4
cargo_cache:
folder: $HOME/.cargo/registry
fingerprint_script: cat Cargo.lock
environment:
CIRRUS_SHELL: powershell
install_script:
- Invoke-WebRequest -Uri https://win.rustup.rs/x86_64 -OutFile rustup-init.exe
- .\rustup-init -y --profile minimal --default-toolchain $env:RUST_VERSION
- Invoke-WebRequest https://releases.wezm.net/upload-to-s3/0.3.0/upload-to-s3-0.3.0-x86_64-pc-windows-msvc.zip -OutFile upload-to-s3.zip
- Expand-Archive upload-to-s3.zip -DestinationPath .
- git fetch --tags
test_script: |
~\.cargo\bin\cargo test --no-default-features --features native-tls
if ($LASTEXITCODE) { Throw }
publish_script: |
try {
$tag=$(git describe --exact-match HEAD 2>$null)
if ($LASTEXITCODE) { Throw }
} catch {
$tag=""
}
if ( $tag.Length -gt 0 ) {
~\.cargo\bin\cargo build --release --locked --no-default-features --features native-tls
if ($LASTEXITCODE) { Throw }
$tarball="feedlynx-$tag-x86_64-pc-windows-msvc.zip"
cd target\release
strip feedlynx.exe
if ($LASTEXITCODE) { Throw }
Compress-Archive .\feedlynx.exe "$tarball"
cd ..\..
.\upload-to-s3 -b releases.wezm.net "target\release\$tarball" "feedlynx/$tag/$tarball"
if ($LASTEXITCODE) { Throw }
}