Skip to content

Commit e9c53c5

Browse files
authored
Update ci.yml
1 parent 45fbf1b commit e9c53c5

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,42 @@ jobs:
1212
strategy:
1313
matrix:
1414
include:
15+
# Linux Debian/Ubuntu targets (.deb enabled)
1516
- os: ubuntu-latest
1617
target: x86_64-unknown-linux-gnu
18+
deb_arch: amd64
1719
ext: tar.gz
1820
deb: true
21+
22+
- os: ubuntu-latest
23+
target: i686-unknown-linux-gnu
24+
deb_arch: i386
25+
ext: tar.gz
26+
deb: true
27+
28+
- os: ubuntu-latest
29+
target: aarch64-unknown-linux-gnu
30+
deb_arch: arm64
31+
ext: tar.gz
32+
deb: true
33+
34+
# macOS targets
1935
- os: macos-latest
2036
target: x86_64-apple-darwin
2137
ext: tar.gz
2238
deb: false
39+
2340
- os: macos-latest
2441
target: aarch64-apple-darwin
2542
ext: tar.gz
2643
deb: false
44+
45+
# Windows target
2746
- os: windows-latest
2847
target: x86_64-pc-windows-msvc
2948
ext: zip
3049
deb: false
31-
50+
3251
steps:
3352
- name: Checkout repository
3453
uses: actions/checkout@v4
@@ -58,6 +77,12 @@ jobs:
5877
- name: Install Rust target
5978
run: rustup target add ${{ matrix.target }}
6079

80+
- name: Install Linux build dependencies
81+
if: matrix.deb == true
82+
run: |
83+
sudo apt-get update
84+
sudo apt-get install -y gcc-multilib
85+
6186
- name: Install cargo-deb (Linux only)
6287
if: matrix.deb == true
6388
run: cargo install cargo-deb
@@ -67,15 +92,13 @@ jobs:
6792
run: |
6893
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
6994
rustup default stable-x86_64-pc-windows-msvc
70-
cargo build --release --target ${{ matrix.target }}
71-
else
72-
cargo build --release --target ${{ matrix.target }}
7395
fi
96+
cargo build --release --target ${{ matrix.target }}
7497
7598
- name: Build .deb package
7699
if: matrix.deb == true
77100
run: |
78-
cargo deb --target ${{ matrix.target }} --no-strip
101+
cargo deb --target ${{ matrix.target }} --deb-arch ${{ matrix.deb_arch }} --no-strip
79102
mkdir -p release_artifacts/${{ matrix.target }}
80103
cp target/${{ matrix.target }}/debian/*.deb release_artifacts/${{ matrix.target }}/
81104
@@ -108,7 +131,7 @@ jobs:
108131
"$hash *$file" | Out-File -Encoding utf8 "$file.sha256"
109132
'
110133
else
111-
sha256sum "$file" > "$file.sha256" || shasum -a 256 "$file" > "$file.sha256"
134+
sha256sum "$file" > "$file.sha256"
112135
fi
113136
114137
- name: Generate SHA256 for .deb (Linux only)
@@ -118,13 +141,12 @@ jobs:
118141
deb_file=$(ls *.deb)
119142
sha256sum "$deb_file" > "$deb_file.sha256"
120143
121-
- name: Sign with GPG
144+
- name: Sign binary with GPG
122145
shell: bash
123146
run: |
124147
cd release_artifacts/${{ matrix.target }}
125148
file="rfortune-${VERSION}-${{ matrix.target }}.${{ matrix.ext }}"
126149
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
127-
128150
echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 \
129151
--pinentry-mode loopback \
130152
--output "$file.sig" --detach-sign "$file"
@@ -151,7 +173,7 @@ jobs:
151173
with:
152174
name: release_artifacts-${{ matrix.target }}
153175
path: release_artifacts/${{ matrix.target }}
154-
176+
155177
consolidate:
156178
name: Consolidate Artifacts
157179
needs: build
@@ -178,7 +200,7 @@ jobs:
178200
with:
179201
name: release_artifacts
180202
path: release_artifacts
181-
203+
182204
release:
183205
name: Create GitHub Release
184206
needs: consolidate
@@ -209,7 +231,7 @@ jobs:
209231
release_artifacts/rfortune-*.tar.gz
210232
release_artifacts/rfortune-*.zip
211233
release_artifacts/*.deb
212-
release_artifacts/rfortune-*.sig
234+
release_artifacts/*.sig
213235
release_artifacts/*.sha256
214236
env:
215237
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)