@@ -9,8 +9,8 @@ permissions:
99 contents : write
1010
1111jobs :
12- build :
13- name : Build for ${{ matrix.target }}
12+ build-cli :
13+ name : Build CLI for ${{ matrix.target }}
1414 runs-on : ${{ matrix.os }}
1515 strategy :
1616 matrix :
5353 name : mp3rgain-${{ matrix.target }}
5454 path : target/${{ matrix.target }}/release/mp3rgain.exe
5555
56+ build-gui :
57+ name : Build GUI for ${{ matrix.target }}
58+ runs-on : ${{ matrix.os }}
59+ strategy :
60+ matrix :
61+ include :
62+ - target : x86_64-apple-darwin
63+ os : macos-latest
64+ - target : aarch64-apple-darwin
65+ os : macos-latest
66+ - target : x86_64-unknown-linux-gnu
67+ os : ubuntu-latest
68+ - target : x86_64-pc-windows-msvc
69+ os : windows-latest
70+
71+ steps :
72+ - uses : actions/checkout@v4
73+
74+ - name : Install Rust
75+ uses : dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
76+ with :
77+ targets : ${{ matrix.target }}
78+
79+ - name : Install Linux dependencies
80+ if : runner.os == 'Linux'
81+ run : |
82+ sudo apt-get update
83+ sudo apt-get install -y libxkbcommon-dev libwayland-dev
84+
85+ - name : Build GUI
86+ run : cargo build --release --manifest-path mp3rgui/Cargo.toml --target ${{ matrix.target }}
87+ env :
88+ RUSTFLAGS : ${{ contains(matrix.target, 'windows') && '-C target-feature=+crt-static' || '' }}
89+
90+ - name : Upload artifact (Unix)
91+ if : runner.os != 'Windows'
92+ uses : actions/upload-artifact@v4
93+ with :
94+ name : mp3rgui-${{ matrix.target }}
95+ path : target/${{ matrix.target }}/release/mp3rgui
96+
97+ - name : Upload artifact (Windows)
98+ if : runner.os == 'Windows'
99+ uses : actions/upload-artifact@v4
100+ with :
101+ name : mp3rgui-${{ matrix.target }}
102+ path : target/${{ matrix.target }}/release/mp3rgui.exe
103+
56104 release :
57105 name : Create Release
58- needs : build
106+ needs : [ build-cli, build-gui]
59107 runs-on : macos-latest
60108 outputs :
61109 version : ${{ steps.version.outputs.version }}
@@ -111,6 +159,27 @@ jobs:
111159 cd ../../dist
112160 shasum -a 256 mp3rgain-${{ github.ref_name }}-windows-arm64.zip > mp3rgain-${{ github.ref_name }}-windows-arm64.zip.sha256
113161
162+ - name : Create GUI universal macOS binary
163+ run : |
164+ lipo -create \
165+ artifacts/mp3rgui-x86_64-apple-darwin/mp3rgui \
166+ artifacts/mp3rgui-aarch64-apple-darwin/mp3rgui \
167+ -output dist/mp3rgui
168+ chmod +x dist/mp3rgui
169+ tar -czvf dist/mp3rgui-${{ github.ref_name }}-macos-universal.tar.gz -C dist mp3rgui
170+ rm dist/mp3rgui
171+
172+ - name : Create GUI Linux tarball
173+ run : |
174+ cd artifacts/mp3rgui-x86_64-unknown-linux-gnu
175+ chmod +x mp3rgui
176+ tar -czvf ../../dist/mp3rgui-${{ github.ref_name }}-linux-x86_64.tar.gz mp3rgui
177+
178+ - name : Create GUI Windows zip
179+ run : |
180+ cd artifacts/mp3rgui-x86_64-pc-windows-msvc
181+ zip ../../dist/mp3rgui-${{ github.ref_name }}-windows-x86_64.zip mp3rgui.exe
182+
114183 - name : Extract checksums
115184 id : checksums
116185 run : |
@@ -130,6 +199,9 @@ jobs:
130199 dist/mp3rgain-${{ github.ref_name }}-windows-x86_64.zip.sha256
131200 dist/mp3rgain-${{ github.ref_name }}-windows-arm64.zip
132201 dist/mp3rgain-${{ github.ref_name }}-windows-arm64.zip.sha256
202+ dist/mp3rgui-${{ github.ref_name }}-macos-universal.tar.gz
203+ dist/mp3rgui-${{ github.ref_name }}-linux-x86_64.tar.gz
204+ dist/mp3rgui-${{ github.ref_name }}-windows-x86_64.zip
133205 draft : true
134206 generate_release_notes : false
135207
0 commit comments