-
Notifications
You must be signed in to change notification settings - Fork 204
153 lines (124 loc) · 4.71 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: build
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
pull_request:
branches:
- '*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
qa:
# For QA (lint, test, etc), Linux is enough
# https://github.com/tauri-apps/tauri-action/issues/745#issuecomment-2024998604
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Install dependencies (ubuntu only)
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install dependencies
run: bun install --frozen-lockfile
- name: 'Test: Rust (+ Generate Types)'
run: bun run gen
- name: 'Test: TS/JS linting & formatting'
run: 'bun run test:lint'
- name: 'Test: unit'
run: 'bun run test:unit'
- name: 'Test: Types'
run: 'bun run test:typings'
- name: 'Test: Circular Dependencies'
run: 'bun run madge --circular --extensions ts --extensions tsx .'
- name: Build application
run: bun run build
# Check one of the command above did not generate any unexpected artifacts
# (like types generation)
- name: Check if git is dirty
run: |
if [[ -n $(git status --porcelain) ]];
then
echo "git is dirty, make sure you ran the gen script"
git status --porcelain
exit 1;
fi
# Documentation on environments:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners
binaries:
needs: qa
permissions:
contents: write
strategy:
fail-fast: false
matrix:
# - include
platform: [macos-latest, ubuntu-24.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Install native dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install frontend dependencies
run: bun install --frozen-lockfile
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
with:
includeUpdaterJson: false
# compile a universal binary for intel + apple sillicon
args: ${{ matrix.platform == 'macos-latest' && '--target universal-apple-darwin' || '' }}
- uses: actions/upload-artifact@v4
if: matrix.platform == 'ubuntu-24.04'
with:
name: binaries-linux
path: |
${{ github.workspace }}/src-tauri/target/release/bundle/**/*.deb
${{ github.workspace }}/src-tauri/target/release/bundle/**/*.rpm
${{ github.workspace }}/src-tauri/target/release/bundle/**/*.AppImage
- uses: actions/upload-artifact@v4
if: matrix.platform == 'macos-latest'
with:
name: binaries-macos
path: |
${{ github.workspace }}/src-tauri/target/release/bundle/**/*.dmg
- uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: binaries-windows
path: |
${{ github.workspace }}/src-tauri/target/release/bundle/**/*.exe