1111
1212jobs :
1313 build :
14- if : ${{ startsWith(github.ref, 'refs/tags/') }}
14+ if : ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
1515 strategy :
1616 fail-fast : false
1717 matrix :
1818 include :
1919 - os : windows-latest
2020 target : x86_64-pc-windows-msvc
21- arch : x86_64
2221 - os : windows-latest
2322 target : aarch64-pc-windows-msvc
24- arch : aarch64
2523 - os : windows-latest
2624 target : i686-pc-windows-msvc
27- arch : x86
2825 - os : macos-latest
2926 target : aarch64-apple-darwin
30- arch : aarch64
3127 - os : macos-latest
3228 target : x86_64-apple-darwin
33- arch : x86_64
3429 - os : ubuntu-latest
3530 target : x86_64-unknown-linux-gnu
36- arch : x86_64
3731 # Can't support `aarch64-unknown-linux-gnu` building yet due to some dependency issues
3832 # - os: ubuntu-latest
3933 # target: aarch64-unknown-linux-gnu
40- # arch: aarch64
4134
4235 runs-on : ${{ matrix.os }}
4336
@@ -54,53 +47,38 @@ jobs:
5447 sudo apt-get install --fix-missing -y libx11-dev libxext-dev libxft-dev libxinerama-dev libxcursor-dev libxrender-dev libxfixes-dev libpango1.0-dev libgl1-mesa-dev libglu1-mesa-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxdo-dev libxmu-dev
5548
5649 - name : Install cargo-bundle
57- run : cargo install cargo-bundle --git https://github.com/burtonageo/cargo-bundle.git
50+ run : cargo install cargo-bundle --git https://github.com/burtonageo/cargo-bundle.git --rev 2580932
5851
5952 - name : Build
60- if : ${{ !cancelled() }}
6153 run : cargo build --release --verbose --all-features --target ${{ matrix.target }}
6254
6355 - name : Bundle (Linux .deb)
64- if : ${{ !cancelled() && matrix.os == 'ubuntu-latest' }}
65- run : cargo bundle --release --format deb --target ${{ matrix.target }}
56+ if : ${{ matrix.os == 'ubuntu-latest' }}
57+ run : |
58+ cargo bundle --format deb --release --target ${{ matrix.target }}
59+ mkdir -p artifact
60+ # cargo-bundle produces arch-specific deb names, find the correct one
61+ DEB_FILE=$(find target/${{ matrix.target }}/release/bundle/deb -name "*.deb")
62+ cp "$DEB_FILE" artifact/overtls-gui-${{ matrix.target }}.deb
6663
6764 - name : Bundle (macOS .app)
68- if : ${{ !cancelled() && matrix.os == 'macos-latest' }}
69- run : cargo bundle --release --format osx --target ${{ matrix.target }}
65+ if : ${{ matrix.os == 'macos-latest' }}
66+ run : |
67+ cargo bundle --format osx --release --target ${{ matrix.target }}
68+ mkdir -p artifact
69+ hdiutil create -volname OverTLS-GUI -srcfolder target/${{ matrix.target }}/release/bundle/osx/overtls-gui.app -ov -format UDZO artifact/overtls-gui-${{ matrix.target }}.dmg
7070
7171 - name : Build installer (Windows .msi)
72- if : ${{ !cancelled() && matrix.os == 'windows-latest' }}
73- run : cargo bundle --release --format wxsmsi --target ${{ matrix.target }}
74-
75- - name : Pack executable
76- if : ${{ !cancelled() }}
72+ if : ${{ matrix.os == 'windows-latest' }}
7773 shell : bash
7874 run : |
79- mkdir -p pubdir
80- if [ "${{ matrix.os }}" == "windows-latest" ]; then
81- cp msi/bin/release/OverTLS-GUI-Installer.msi pubdir/overtls-gui-windows-${{ matrix.arch }}.msi
82- fi
83- if [ "${{ matrix.os }}" == "macos-latest" ]; then
84- hdiutil create -volname OverTLS-GUI -srcfolder target/${{ matrix.target }}/release/bundle/osx/OverTLS-GUI.app -ov -format UDZO pubdir/overtls-gui-macos-${{ matrix.arch }}.dmg
85- fi
86- if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
87- # cargo-bundle produces arch-specific deb names, find the correct one
88- DEB_FILE=$(find target/${{ matrix.target }}/release/bundle/deb -name "*.deb")
89- cp "$DEB_FILE" pubdir/overtls-gui-linux-${{ matrix.arch }}.deb
90- fi
91-
92- ls -lh pubdir
93- echo "Artifacts are ready"
75+ cargo bundle --format wxsmsi --release --target ${{ matrix.target }}
76+ mkdir -p artifact
77+ cp target/${{ matrix.target }}/release/bundle/wxsmsi/bin/Release/overtls-gui.msi artifact/overtls-gui-${{ matrix.target }}.msi
9478
9579 - name : Publish
96- if : ${{ !cancelled() }}
9780 uses : softprops/action-gh-release@v2
9881 env :
9982 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
10083 with :
101- files : pubdir/*
102-
103- - name : Abort on error
104- if : ${{ failure() }}
105- run : echo "Some of jobs failed" && false
106-
84+ files : artifact/*
0 commit comments