55 branches : [ "master" ]
66 pull_request :
77 branches : [ "master" ]
8+ release :
9+ types : [published]
810
911env :
1012 CARGO_TERM_COLOR : always
@@ -24,13 +26,19 @@ jobs:
2426 run : cargo build --verbose --release
2527 - name : Copy Dependencies
2628 run : cp ./resources/aria2c.exe ./target/release/aria2c.exe && cp ./resources/sciter.dll ./target/release/sciter.dll
29+ - name : Create Windows zip
30+ run : |
31+ $VERSION = "${{ github.ref_name }}".Substring(1)
32+ Compress-Archive -Path ./target/release/cele-mod.exe,./target/release/aria2c.exe,./target/release/sciter.dll -DestinationPath "celemod-${VERSION}-windows.zip"
33+ echo "VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
34+ 35+ with :
36+ name : windows-exe
37+ path : ./target/release/cele-mod.exe
27382839 with :
29- name : windows
30- path : |
31- ./target/release/cele-mod.exe
32- ./target/release/aria2c.exe
33- ./target/release/sciter.dll
40+ name : windows-zip
41+ path : celemod-${{ env.VERSION }}-windows.zip
3442 build-linux :
3543 runs-on : ubuntu-22.04
3644 steps :
@@ -54,11 +62,16 @@ jobs:
5462 components : rustfmt, clippy
5563 - name : Build Rust
5664 run : cargo build --verbose --release
65+ - name : Create Linux zip
66+ run : |
67+ VERSION=${{ github.ref_name }}
68+ VERSION=${VERSION#v}
69+ zip "celemod-${VERSION}-linux.zip" ./target/release/cele-mod
70+ echo "VERSION=$VERSION" >> $GITHUB_ENV
57715872 with :
59- name : linux
60- path : |
61- ./target/release/cele-mod
73+ name : linux-zip
74+ path : celemod-${{ env.VERSION }}-linux.zip
6275 build-osx :
6376 runs-on : macos-latest
6477 steps :
@@ -76,38 +89,48 @@ jobs:
7689 components : rustfmt, clippy
7790 - name : Build Rust
7891 run : cargo build --verbose --release
92+ - name : Create OSX zip
93+ run : |
94+ VERSION=${{ github.ref_name }}
95+ VERSION=${VERSION#v}
96+ zip "celemod-${VERSION}-osx.zip" ./target/release/cele-mod
97+ echo "VERSION=$VERSION" >> $GITHUB_ENV
79988099 with :
81- name : osx
82- path : |
83- ./target/release/cele-mod
100+ name : osx-zip
101+ path : celemod-${{ env.VERSION }}-osx.zip
84102 release :
85- needs : [build-windows, build-linux, build-osx]
86103 runs-on : ubuntu-latest
87- if : github.event_name == 'push' && github.ref == 'refs/heads/master'
104+ needs : [build-windows, build-linux, build-osx]
105+ if : github.event_name == 'release'
88106 steps :
89- - uses : actions/checkout@v3
90- - name : Get version
91- run : echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
92107 - uses : actions/download-artifact@v4
93108 with :
94- name : windows
95- path : artifacts/windows/
109+ name : windows-exe
110+ path : .
96111 - uses : actions/download-artifact@v4
97112 with :
98- name : linux
99- path : artifacts/linux/
113+ name : windows-zip
114+ path : .
100115 - uses : actions/download-artifact@v4
101116 with :
102- name : osx
103- path : artifacts/osx/
104- - name : Create Release
105- uses : softprops/action-gh-release@v1
117+ name : linux-zip
118+ path : .
119+ - uses : actions/download-artifact@v4
120+ with :
121+ name : osx-zip
122+ path : .
123+ - name : Prepare release files
124+ run : |
125+ VERSION=${{ github.ref_name }}
126+ VERSION=${VERSION#v}
127+ mv cele-mod.exe "cele-mod-no-dependencies-${VERSION}.exe"
128+ - uses : softprops/action-gh-release@v1
106129 with :
107- tag_name : v${{ env.VERSION }}
108130 files : |
109- artifacts/windows/*
110- artifacts/linux/*
111- artifacts/osx/*
131+ cele-mod-no-dependencies-${VERSION}.exe
132+ celemod-${VERSION}-windows.zip
133+ celemod-${VERSION}-linux.zip
134+ celemod-${VERSION}-osx.zip
112135 env :
113136 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments