Skip to content

Commit a088c15

Browse files
author
João Dias
committed
chore: changed publish action to support Tauri
1 parent 977a66d commit a088c15

File tree

1 file changed

+46
-29
lines changed

1 file changed

+46
-29
lines changed

.github/workflows/publish.yml

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,62 @@
1-
name: Publish
1+
name: 'publish'
22

33
on:
44
push:
55
branches:
6-
- main
6+
- release
77

8-
jobs:
9-
publish:
10-
# To enable auto publishing to github, update your electron publisher
11-
# config in package.json > "build" and remove the conditional below
12-
if: ${{ github.repository_owner == 'electron-react-boilerplate' }}
13-
14-
runs-on: ${{ matrix.os }}
8+
# This workflow will trigger on each push to the `release` branch to create or update a GitHub release, build your app, and upload the artifacts to the release.
159

10+
jobs:
11+
publish-tauri:
12+
permissions:
13+
contents: write
1614
strategy:
15+
fail-fast: false
1716
matrix:
18-
os: [macos-latest]
19-
17+
include:
18+
- platform: 'macos-latest' # for Arm based macs (M1 and above).
19+
args: '--target aarch64-apple-darwin'
20+
- platform: 'macos-latest' # for Intel based macs.
21+
args: '--target x86_64-apple-darwin'
22+
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
23+
args: ''
24+
- platform: 'windows-latest'
25+
args: ''
26+
27+
runs-on: ${{ matrix.platform }}
2028
steps:
21-
- name: Checkout git repo
22-
uses: actions/checkout@v1
29+
- uses: actions/checkout@v4
2330

24-
- name: Install Node and NPM
25-
uses: actions/setup-node@v1
31+
- name: setup node
32+
uses: actions/setup-node@v4
2633
with:
27-
node-version: 20
34+
node-version: lts/*
2835

29-
- name: Install dependencies
36+
- name: install Rust stable
37+
uses: dtolnay/rust-toolchain@stable
38+
with:
39+
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
40+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
41+
42+
- name: install dependencies (ubuntu only)
43+
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
3044
run: |
31-
npm install
45+
sudo apt-get update
46+
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
47+
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
48+
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
49+
50+
- name: install frontend dependencies
51+
run: yarn install # change this to npm, pnpm or bun depending on which one you use.
3252

33-
- name: Publish releases
53+
- uses: tauri-apps/tauri-action@v0
3454
env:
35-
# These values are used for auto updates signing
36-
APPLE_ID: ${{ secrets.APPLE_ID }}
37-
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
38-
CSC_LINK: ${{ secrets.CSC_LINK }}
39-
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
40-
# This is used for uploading release assets to github
4155
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
run: |
43-
npm run postinstall
44-
npm run build
45-
npm exec electron-builder -- --publish always --win --mac --linux
56+
with:
57+
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
58+
releaseName: 'App v__VERSION__'
59+
releaseBody: 'See the assets to download this version and install.'
60+
releaseDraft: true
61+
prerelease: false
62+
args: ${{ matrix.args }}

0 commit comments

Comments
 (0)