66on : [push]
77
88jobs :
9- build :
10- runs-on : ubuntu-latest
9+ build-tauri :
10+ name : Build Tauri Application
11+ permissions :
12+ contents : write
13+ strategy :
14+ fail-fast : false
15+ matrix :
16+ settings :
17+ - platform : ' ubuntu-22.04'
18+ args : ' '
19+ # TODO: maybe target specifically ARM based macs and Intel based macs to reduce built bundle size
20+ # - platform: 'macos-latest' # for Arm based macs (M1 and above).
21+ # args: '--target aarch64-apple-darwin'
22+ # - platform: 'macos-latest' # for Intel based macs.
23+ # args: '--target x86_64-apple-darwin'
24+ - platform : ' macos-latest'
25+ args : ' --target universal-apple-darwin'
26+ - platform : ' windows-latest'
27+ args : ' '
1128
29+ runs-on : ${{ matrix.settings.platform }}
30+ env :
31+ CI : true
1232 steps :
1333 - uses : actions/checkout@v4
1434
35+ - name : Install Dependencies (Ubuntu only)
36+ if : matrix.settings.platform == 'ubuntu-22.04' # This must match the platform value defined above.
37+ run : |
38+ sudo apt-get update
39+ sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
40+
41+ - name : Set up Node
42+ uses : actions/setup-node@v4
43+ with :
44+ node-version : lts/*
45+ cache : ' npm'
46+
1547 - name : Install Rust
1648 uses : dtolnay/rust-toolchain@stable
1749 with :
18- components : rustfmt, clippy
50+ # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
51+ targets : ${{ matrix.settings.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
1952
20- - name : Setup Node.js
21- 53+ - name : Set up Rust Cache
54+ uses : swatinem/rust-cache@v2
55+
56+ - name : Install Node Dependencies
57+ run : npm install
58+
59+ - uses : tauri-apps/tauri-action@v0
60+ env :
61+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2262 with :
23- node-version : ' 16.x'
63+ releaseBody : ' See the assets to download this version and install.'
64+ releaseDraft : true
65+ prerelease : false
66+ args : ${{ matrix.settings.args }}
2467
25- - name : Install dependencies
26- run : |
27- sudo apt-get update
28- sudo apt-get install -y libgtk-3-dev \
29- webkit2gtk-4.0 javascriptcoregtk-4.1 libappindicator3-dev \
30- librsvg2-dev patchelf libdbus-1-dev \
31- pkg-config \
68+ # Linux
69+ - name : Upload Linux deb
70+ uses : actions/upload-artifact@v4
71+ if : matrix.settings.platform == 'ubuntu-22.04'
72+ with :
73+ name : ark-rate-desktop_linux_deb
74+ path : ./src-tauri/target/release/bundle/deb/*.deb
3275
33- - name : Fetch Node.js Dependencies
34- run : yarn
76+ - name : Upload Linux rpm
77+ uses : actions/upload-artifact@v4
78+ if : matrix.settings.platform == 'ubuntu-22.04'
79+ with :
80+ name : ark-rate-desktop_linux_rpm
81+ path : ./src-tauri/target/release/bundle/rpm/*.rpm
3582
36- - name : Build Release version
37- run : yarn tauri build
83+ - name : Upload Linux AppImage
84+ uses : actions/upload-artifact@v4
85+ if : matrix.settings.platform == 'ubuntu-22.04'
86+ with :
87+ name : ark-rate-desktop_linux_appimage
88+ path : ./src-tauri/target/release/bundle/appimage/*.AppImage
89+ # ---
90+
91+ # MacOS
92+ - name : Upload MacOS app
93+ uses : actions/upload-artifact@v4
94+ if : matrix.settings.platform == 'macos-latest'
95+ with :
96+ name : ark-rate-desktop_macos_app
97+ path : ./src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app
98+
99+ - name : Upload MacOS dmg
100+ uses : actions/upload-artifact@v4
101+ if : matrix.settings.platform == 'macos-latest'
102+ with :
103+ name : ark-rate-desktop_macos_dmg
104+ path : ./src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
105+ # ---
106+
107+ # Windows
108+ - name : Upload Windows msi
109+ uses : actions/upload-artifact@v4
110+ if : matrix.settings.platform == 'windows-latest'
111+ with :
112+ name : ark-rate-desktop_windows_msi
113+ path : ./src-tauri/target/release/bundle/msi/*.msi
38114
39- - name : Upload AppImage
40- 115+ - name : Upload Windows exe
116+ uses : actions/upload-artifact@v4
117+ if : matrix.settings.platform == 'windows-latest'
41118 with :
42- name : ark-rate-desktop.AppImage
43- path : ./src-tauri/target/release/bundle/appimage/ark-rate-desktop_*_amd64.AppImage
119+ name : ark-rate-desktop_windows_exe
120+ path : ./src-tauri/target/release/bundle/nsis/*.exe
121+ # ---
0 commit comments