@@ -2,9 +2,10 @@ name: Build Compotes app.
22
33on :
44 push :
5- branches : [ rewrite ]
5+ branches : [ main ]
6+ tags : [ 'v[0-9]+.*' ]
67 pull_request :
7- branches : [ rewrite ]
8+ branches : [ main ]
89
910jobs :
1011 build :
1718
1819 runs-on : ${{ matrix.os }}
1920 steps :
20- - { name: "Checkout the code", uses: actions/checkout@v2 }
21-
21+ - uses : actions/checkout@v4
2222 - name : 🗄️ Setup Rust cache
2323 uses : actions/cache@v2
2424 with :
@@ -32,11 +32,11 @@ jobs:
3232 - name : 🍃 Install Node.js
3333 uses : actions/setup-node@v2
3434 with :
35- node-version : 16
36- cache : yarn
37- cache-dependency-path : |
38- yarn.lock
39- tests/webdriverio/ yarn.lock
35+ node-version : 18
36+
37+ - name : 🍃 Install Yarn
38+ run : |
39+ npm i -g npm yarn
4040
4141 - name : 🦀 Install Rust
4242 uses : actions-rs/toolchain@v1
@@ -77,10 +77,88 @@ jobs:
7777 run : |
7878 yarn test
7979
80- - name : 🚀 Upload release artifacts
81- uses : actions/upload-artifact@v2
80+ - name : 🗃 Store artifacts (release only)
81+ uses : actions/upload-artifact@v4
82+ if : matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/v')
8283 with :
83- name : release-${{ matrix.os }}
84- path : |
85- src-tauri/target/release/compotes*
86- src-tauri/target/release/bundle/*
84+ name : compotes_artifacts_${{ matrix.os }}
85+ overwrite : true
86+ path : |
87+ src-tauri/target/release/compotes
88+ src-tauri/target/release/bundle/deb/*.deb
89+
90+ - name : 🗃 Store Windows artifacts (release only)
91+ uses : actions/upload-artifact@v4
92+ if : matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/v')
93+ with :
94+ name : compotes_artifacts_${{ matrix.os }}
95+ overwrite : true
96+ path : |
97+ src-tauri/target/release/compotes.exe
98+ src-tauri/target/release/bundle/msi/*.msi
99+
100+ release :
101+ runs-on : ubuntu-latest
102+ needs :
103+ - build
104+ if : startsWith(github.ref, 'refs/tags/v')
105+ steps :
106+ - uses : actions/checkout@v4
107+
108+ - name : Create release
109+ uses : actions/create-release@v1
110+ id : create_release
111+ with :
112+ draft : false
113+ prerelease : false
114+ release_name : ${{ steps.version.outputs.version }}
115+ tag_name : ${{ github.ref }}
116+ # body_path: CHANGELOG.md
117+ env :
118+ GITHUB_TOKEN : ${{ github.token }}
119+
120+ - name : 🗃 Download built artifacts
121+ uses : actions/download-artifact@v4
122+ with :
123+ path : src-tauri/target/release
124+ merge-multiple : true
125+
126+ - name : Upload Windows executable
127+ uses : svenstaro/upload-release-action@v2
128+ with :
129+ repo_token : ${{ secrets.GITHUB_TOKEN }}
130+ file : src-tauri/target/release/compotes.exe
131+ asset_name : compotes_${{ github.ref_name }}.exe
132+ tag : ${{ github.ref_name }}
133+ overwrite : true
134+ file_glob : true
135+
136+ - name : Upload Windows installer
137+ uses : svenstaro/upload-release-action@v2
138+ with :
139+ repo_token : ${{ secrets.GITHUB_TOKEN }}
140+ file : src-tauri/target/release/bundle/msi/compotes_*.msi
141+ asset_name : compotes_${{ github.ref_name }}_installer.msi
142+ tag : ${{ github.ref_name }}
143+ overwrite : true
144+ file_glob : true
145+
146+ - name : Upload Linux executable
147+ uses : svenstaro/upload-release-action@v2
148+ with :
149+ repo_token : ${{ secrets.GITHUB_TOKEN }}
150+ file : src-tauri/target/release/compotes
151+ asset_name : compotes_${{ github.ref_name }}
152+ tag : ${{ github.ref_name }}
153+ overwrite : true
154+ file_glob : true
155+
156+ - name : Upload Linux deb package
157+ uses : svenstaro/upload-release-action@v2
158+ with :
159+ repo_token : ${{ secrets.GITHUB_TOKEN }}
160+ file : src-tauri/target/release/bundle/deb/compotes_*.deb
161+ asset_name : compotes_${{ github.ref_name }}.deb
162+ tag : ${{ github.ref_name }}
163+ overwrite : true
164+ file_glob : true
0 commit comments