11name : Release
22
33on :
4- push :
5- tags :
6- - " v*"
4+ push :
5+ tags :
6+ - " v*"
77
88jobs :
9- build-windows :
10- runs-on : windows-latest
11- steps :
12- - uses : actions/checkout@v3
13- - name : Build
14- run : cargo build --verbose --release
15- - name : Upload executable
16- uses : actions/upload-artifact@v3
17- with :
18- name : rua-windows
19- path : target/release/rua.exe
9+ build-windows :
10+ runs-on : windows-latest
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+
15+ - name : Build
16+ run : cargo build --verbose --release
17+
18+ - name : Upload executable
19+ uses : actions/upload-artifact@v4
20+ with :
21+ name : rua-windows
22+ path : target/release/rua.exe
2023
21- build-linux :
22- runs-on : ubuntu-latest
23- steps :
24- - uses : actions/checkout@v3
25- - name : Build
26- run : cargo build --verbose --release
27- - name : Upload executable
28- uses : actions/upload-artifact@v3
29- with :
30- name : rua-linux
31- path : target/release/rua
24+ build-linux :
25+ runs-on : ubuntu-latest
26+ steps :
27+ - name : Checkout code
28+ uses : actions/checkout@v4
29+
30+ - name : Build
31+ run : cargo build --verbose --release
32+
33+ - name : Upload executable
34+ uses : actions/upload-artifact@v4
35+ with :
36+ name : rua-linux
37+ path : target/release/rua
3238
33- create-release :
34- runs-on : ubuntu-latest
35- needs : [build-windows, build-linux]
36- steps :
37- - name : Download all artifacts
38- uses : actions/download-artifact@v3
39- with :
40- path : dist
41- - name : Create Release
42- id : create_release
43- uses : actions/create-release@v1
44- env :
45- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46- with :
47- tag_name : ${{ github.ref_name }}-${{ github.sha }}
48- release_name : Release ${{ github.ref_name }}
49- draft : false
50- prerelease : false
51- - name : Upload Release Asset - Windows
52- id : upload-release-asset-windows
53- uses : actions/upload-release-asset@v1
54- env :
55- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56- with :
57- upload_url : ${{ steps.create_release.outputs.upload_url }}
58- asset_path : dist/rua-windows/rua.exe
59- asset_name : rua-windows.exe
60- asset_content_type : application/octet-stream
61- - name : Upload Release Asset - Linux
62- id : upload-release-asset-linux
63- uses : actions/upload-release-asset@v1
64- env :
65- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66- with :
67- upload_url : ${{ steps.create_release.outputs.upload_url }}
68- asset_path : dist/rua-linux/rua
69- asset_name : rua-linux
70- asset_content_type : application/octet-stream
39+ create-release :
40+ runs-on : ubuntu-latest
41+ needs : [build-windows, build-linux]
42+ permissions :
43+ contents : write # This permission is required to create a release
44+ steps :
45+ - name : Download all artifacts
46+ uses : actions/download-artifact@v4
47+ with :
48+ path : dist
49+
50+ - name : Create Release and Upload Assets
51+ uses : softprops/action-gh-release@v2
52+ with :
53+ # This will use the tag that triggered the workflow as the release name
54+ name : Release ${{ github.ref_name }}
55+ # This will upload both the Windows and Linux executables
56+ files : |
57+ dist/rua-windows/rua.exe
58+ dist/rua-linux/rua
0 commit comments