Skip to content

Commit 005c642

Browse files
committed
ci: update workflows for Tauri and Vitest
1 parent 1989ef9 commit 005c642

File tree

3 files changed

+94
-157
lines changed

3 files changed

+94
-157
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -7,98 +7,64 @@ permissions:
77
contents: read
88

99
jobs:
10-
build-macos:
11-
name: Build macOS (electron-builder)
12-
runs-on: macos-latest
10+
build-tauri:
11+
name: Build Tauri App
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- platform: macos-latest
17+
args: --target aarch64-apple-darwin
18+
artifact-name: Gitify-dist-mac-arm64
19+
- platform: macos-latest
20+
args: --target x86_64-apple-darwin
21+
artifact-name: Gitify-dist-mac-x64
22+
- platform: ubuntu-22.04
23+
args: ''
24+
artifact-name: Gitify-dist-linux
25+
- platform: windows-latest
26+
args: ''
27+
artifact-name: Gitify-dist-win
1328

14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17-
18-
- name: Setup pnpm
19-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
20-
21-
- name: Setup Node
22-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
23-
with:
24-
node-version-file: '.nvmrc'
25-
cache: 'pnpm'
26-
27-
- run: pnpm install
28-
- run: pnpm build
29-
- run: pnpm package:macos --publish=never -c.mac.identity=null
30-
env:
31-
CSC_LINK: ${{ secrets.CSC_LINK }}
32-
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
33-
34-
- name: Clean up builds
35-
run: rm -rfv dist/mac-universal
36-
37-
- name: Upload artifacts
38-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
39-
with:
40-
name: Gitify-dist-mac
41-
path: dist/
42-
overwrite: true
43-
44-
build-windows:
45-
name: Build Windows (electron-builder)
46-
runs-on: windows-latest
29+
runs-on: ${{ matrix.platform }}
4730

4831
steps:
4932
- name: Checkout
5033
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5134

5235
- name: Setup pnpm
5336
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
54-
37+
5538
- name: Setup Node
5639
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
5740
with:
5841
node-version-file: '.nvmrc'
5942
cache: 'pnpm'
60-
61-
- run: pnpm install
62-
- run: pnpm build
63-
- run: pnpm package:win --publish=never
64-
65-
- name: Clean up builds
66-
run: Remove-Item dist/win-unpacked -Recurse
67-
68-
- name: Upload artifacts
69-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
43+
44+
- name: Install Rust stable
45+
uses: dtolnay/rust-action@e645b0cf126e4de3e4307c0dc05270e8edd02507 # stable
7046
with:
71-
name: Gitify-dist-win
72-
path: dist
73-
overwrite: true
47+
toolchain: stable
48+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
7449

75-
build-linux:
76-
name: Build Linux (electron-builder)
77-
runs-on: ubuntu-latest
50+
- name: Install dependencies (ubuntu only)
51+
if: matrix.platform == 'ubuntu-22.04'
52+
run: |
53+
sudo apt-get update
54+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
7855
79-
steps:
80-
- name: Checkout
81-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
56+
- run: pnpm install
8257

83-
- name: Setup pnpm
84-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
85-
86-
- name: Setup Node
87-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
58+
- name: Build Tauri app
59+
uses: tauri-apps/tauri-action@42bc3e23e6c7bdd4e28d7fb02e9bc03bd3aef95e # v0.5.23
8860
with:
89-
node-version-file: '.nvmrc'
90-
cache: 'pnpm'
91-
92-
- run: pnpm install
93-
- run: pnpm build
94-
- run: pnpm package:linux --publish=never
95-
96-
- name: Clean up builds
97-
run: rm -rfv dist/linux-unpacked
98-
61+
args: ${{ matrix.args }}
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
9965
- name: Upload artifacts
10066
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
10167
with:
102-
name: Gitify-dist-linux
103-
path: dist
68+
name: ${{ matrix.artifact-name }}
69+
path: src-tauri/target/**/bundle/**
10470
overwrite: true

.github/workflows/publish.yml

Lines changed: 54 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,85 @@
11
name: Publish
22

3-
on:
3+
on:
44
workflow_call:
55
workflow_dispatch: # For manually running release process to verify code-signing of artifacts
66

77
permissions:
88
contents: write
99

1010
jobs:
11-
release-macos:
12-
name: Publish macOS (electron-builder)
13-
runs-on: macos-latest
11+
publish-tauri:
12+
name: Publish Tauri App
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- platform: macos-latest
18+
args: --target aarch64-apple-darwin
19+
artifact-name: Gitify-release-mac-arm64
20+
- platform: macos-latest
21+
args: --target x86_64-apple-darwin
22+
artifact-name: Gitify-release-mac-x64
23+
- platform: ubuntu-22.04
24+
args: ''
25+
artifact-name: Gitify-release-linux
26+
- platform: windows-latest
27+
args: ''
28+
artifact-name: Gitify-release-win
1429

15-
steps:
16-
- name: Checkout
17-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
18-
19-
- name: Setup pnpm
20-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
21-
22-
- name: Setup Node
23-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
24-
with:
25-
node-version-file: '.nvmrc'
26-
cache: 'pnpm'
27-
28-
- run: pnpm install
29-
- run: pnpm build
30-
env:
31-
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
32-
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
33-
- run: pnpm package:macos --publish onTagOrDraft
34-
env:
35-
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
36-
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
37-
APPLE_ID_TEAM_ID: ${{ secrets.APPLE_ID_TEAM_ID }}
38-
CSC_LINK: ${{ secrets.CSC_LINK }}
39-
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
40-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
NOTARIZE: true
42-
43-
- name: Upload artifacts
44-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
45-
with:
46-
name: Gitify-release-mac
47-
path: dist/
48-
overwrite: true
49-
50-
release-windows:
51-
name: Publish Windows (electron-builder)
52-
runs-on: windows-latest
30+
runs-on: ${{ matrix.platform }}
5331

5432
steps:
5533
- name: Checkout
5634
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5735

5836
- name: Setup pnpm
5937
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
60-
38+
6139
- name: Setup Node
6240
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
6341
with:
6442
node-version-file: '.nvmrc'
6543
cache: 'pnpm'
66-
67-
- run: pnpm install
68-
- run: pnpm build
69-
env:
70-
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
71-
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
72-
- run: pnpm package:win --publish onTagOrDraft
73-
env:
74-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75-
76-
- name: Upload artifacts
77-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
44+
45+
- name: Install Rust stable
46+
uses: dtolnay/rust-action@e645b0cf126e4de3e4307c0dc05270e8edd02507 # stable
7847
with:
79-
name: Gitify-release-win
80-
path: dist/
81-
overwrite: true
48+
toolchain: stable
49+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
8250

83-
release-linux:
84-
name: Publish Linux (electron-builder)
85-
runs-on: ubuntu-latest
51+
- name: Install dependencies (ubuntu only)
52+
if: matrix.platform == 'ubuntu-22.04'
53+
run: |
54+
sudo apt-get update
55+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
8656
87-
steps:
88-
- name: Checkout
89-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
57+
- run: pnpm install
9058

91-
- name: Setup pnpm
92-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
93-
94-
- name: Setup Node
95-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
59+
- name: Build and publish Tauri app
60+
uses: tauri-apps/tauri-action@42bc3e23e6c7bdd4e28d7fb02e9bc03bd3aef95e # v0.5.23
9661
with:
97-
node-version-file: '.nvmrc'
98-
cache: 'pnpm'
99-
100-
- run: pnpm install
101-
- run: pnpm build
102-
env:
103-
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
104-
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
105-
- run: pnpm package:linux --publish onTagOrDraft
62+
tagName: v__VERSION__
63+
releaseName: 'Gitify v__VERSION__'
64+
releaseBody: 'See the assets to download this version and install.'
65+
releaseDraft: true
66+
prerelease: false
67+
args: ${{ matrix.args }}
10668
env:
107-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108-
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
# macOS code signing
71+
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
72+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
73+
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
74+
APPLE_ID: ${{ secrets.APPLE_ID_USERNAME }}
75+
APPLE_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
76+
APPLE_TEAM_ID: ${{ secrets.APPLE_ID_TEAM_ID }}
77+
# OAuth for the app
78+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
79+
10980
- name: Upload artifacts
11081
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
11182
with:
112-
name: Gitify-release-linux
113-
path: dist/
114-
overwrite: true
83+
name: ${{ matrix.artifact-name }}
84+
path: src-tauri/target/**/bundle/**
85+
overwrite: true

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- run: pnpm install
2828
- run: pnpm tsc --noEmit
29-
- run: pnpm test --coverage --runInBand --verbose
29+
- run: pnpm test --coverage
3030

3131
- name: Archive code coverage results
3232
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0

0 commit comments

Comments
 (0)