Skip to content

Commit 686fc31

Browse files
authored
Merge pull request #3 from Athemis/feature/32bit-release-targets
Feature/32bit release targets
2 parents c011386 + 29151c5 commit 686fc31

2 files changed

Lines changed: 41 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,42 @@ jobs:
6161
archive: tar.gz
6262
rustflags: ""
6363
linux: true
64+
pkg_config_libdir: ""
65+
multilib: false
6466
- runner: windows-latest
6567
target: x86_64-pc-windows-msvc
6668
archive: zip
6769
rustflags: ""
6870
linux: false
71+
pkg_config_libdir: ""
72+
multilib: false
73+
- runner: ubuntu-latest
74+
target: i686-unknown-linux-gnu
75+
archive: tar.gz
76+
rustflags: ""
77+
linux: true
78+
pkg_config_libdir: "/usr/lib/i386-linux-gnu/pkgconfig"
79+
multilib: true
80+
- runner: windows-latest
81+
target: i686-pc-windows-msvc
82+
archive: zip
83+
rustflags: ""
84+
linux: false
85+
pkg_config_libdir: ""
86+
multilib: false
6987
runs-on: ${{ matrix.runner }}
7088
env:
7189
TARGET: ${{ matrix.target }}
7290
RUSTFLAGS: ${{ matrix.rustflags }}
91+
PKG_CONFIG_LIBDIR: ${{ matrix.pkg_config_libdir }}
7392
steps:
7493
- name: Checkout
7594
uses: actions/checkout@v6
7695

96+
- name: Set safe ref name
97+
shell: bash
98+
run: echo "SAFE_REF=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_ENV"
99+
77100
- name: Install stable toolchain
78101
uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
79102
with:
@@ -90,6 +113,17 @@ jobs:
90113
libgl1-mesa-dev libasound2-dev libudev-dev \
91114
libwayland-dev libxkbcommon-dev
92115
116+
- name: Install 32-bit Linux deps
117+
if: matrix.target == 'i686-unknown-linux-gnu'
118+
run: |
119+
sudo dpkg --add-architecture i386
120+
sudo apt-get update
121+
sudo apt-get install -y \
122+
gcc-multilib g++-multilib pkg-config \
123+
libx11-dev:i386 libxcursor-dev:i386 libxrandr-dev:i386 libxi-dev:i386 \
124+
libgl1-mesa-dev:i386 libasound2-dev:i386 libudev-dev:i386 \
125+
libwayland-dev:i386 libxkbcommon-dev:i386
126+
93127
- name: Cache cargo
94128
uses: actions/cache@v4
95129
with:
@@ -104,10 +138,6 @@ jobs:
104138
- name: Build release
105139
run: cargo build --release --target ${{ matrix.target }}
106140

107-
- name: Strip binary (Linux)
108-
if: matrix.linux
109-
run: strip --strip-unneeded target/$TARGET/release/elnpack
110-
111141
- name: Package artifact (Linux)
112142
if: matrix.archive == 'tar.gz'
113143
run: |
@@ -116,7 +146,7 @@ jobs:
116146
mkdir -p "$pkg_dir"
117147
cp "$bin_path" "$pkg_dir/"
118148
cp README.md LICENSE "$pkg_dir/"
119-
tar -czf elnpack-${{ github.ref_name }}-$TARGET.tar.gz -C "$pkg_dir" .
149+
tar -czf "elnpack-$SAFE_REF-$TARGET.tar.gz" -C "$pkg_dir" .
120150
121151
- name: Package artifact (Windows)
122152
if: matrix.archive == 'zip'
@@ -127,14 +157,15 @@ jobs:
127157
New-Item -ItemType Directory -Force -Path $pkgDir | Out-Null
128158
Copy-Item $binPath "$pkgDir/"
129159
Copy-Item "README.md","LICENSE" "$pkgDir/"
130-
Compress-Archive -Path "$pkgDir/*" -DestinationPath "elnpack-${{ github.ref_name }}-${env:TARGET}.zip"
160+
$safeRef = $env:SAFE_REF
161+
Compress-Archive -Path "$pkgDir/*" -DestinationPath "elnpack-$safeRef-${env:TARGET}.zip"
131162
132163
- name: Upload artifact
133164
uses: actions/upload-artifact@v4
134165
with:
135-
name: elnpack-${{ github.ref_name }}-${{ matrix.target }}
166+
name: elnpack-${{ env.SAFE_REF }}-${{ matrix.target }}
136167
path: |
137-
elnpack-${{ github.ref_name }}-${{ matrix.target }}.${{ matrix.archive }}
168+
elnpack-${{ env.SAFE_REF }}-${{ matrix.target }}.${{ matrix.archive }}
138169
139170
publish:
140171
name: Publish Release

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ deunicode = "1.6"
3030
tempfile = "3.14"
3131

3232
[profile.release]
33-
lto = true
33+
lto = "thin"
3434
panic = "abort"
35-
strip = "debuginfo"
35+
strip = "symbols"

0 commit comments

Comments
 (0)