-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (196 loc) · 6.49 KB
/
release.yml
File metadata and controls
227 lines (196 loc) · 6.49 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: release
on:
push:
branches: [master]
tags: ["v*"]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build-tauri:
name: build (${{ matrix.label }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
label: Linux x86_64
artifact: fastpack-linux-x86_64.AppImage
bundle: appimage
glob: "appimage/*.AppImage"
- os: windows-latest
target: x86_64-pc-windows-msvc
label: Windows x86_64
artifact: fastpack-windows-x86_64-setup.exe
bundle: nsis
glob: "nsis/*.exe"
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
cache-dependency-path: crates/fastpack-tauri/pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
shared-key: "release-${{ matrix.target }}"
cache-on-failure: "true"
- name: system deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update -q
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf
- name: install frontend deps
working-directory: crates/fastpack-tauri
run: pnpm install
- uses: tauri-apps/tauri-action@v0
id: tauri
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: crates/fastpack-tauri
tauriScript: pnpm tauri
args: --target ${{ matrix.target }} --bundles ${{ matrix.bundle }}
- name: rename artifact
shell: bash
run: |
FILE=$(find target/${{ matrix.target }}/release/bundle/${{ matrix.glob }} | head -1)
cp "$FILE" "${{ matrix.artifact }}"
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
build-macos:
name: build (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
cache-dependency-path: crates/fastpack-tauri/pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- uses: Swatinem/rust-cache@v2
with:
shared-key: release-macos
cache-on-failure: "true"
- name: install frontend deps
working-directory: crates/fastpack-tauri
run: pnpm install
- name: build ARM
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERT_P12 }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
with:
projectPath: crates/fastpack-tauri
tauriScript: pnpm tauri
args: --target aarch64-apple-darwin --bundles dmg
- name: rename ARM artifact
run: |
FILE=$(find target/aarch64-apple-darwin/release/bundle/dmg/*.dmg | head -1)
cp "$FILE" fastpack-macos-aarch64.dmg
- name: build Intel
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERT_P12 }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
with:
projectPath: crates/fastpack-tauri
tauriScript: pnpm tauri
args: --target x86_64-apple-darwin --bundles dmg
- name: rename Intel artifact
run: |
FILE=$(find target/x86_64-apple-darwin/release/bundle/dmg/*.dmg | head -1)
cp "$FILE" fastpack-macos-x86_64.dmg
- uses: actions/upload-artifact@v4
with:
name: fastpack-macos-aarch64.dmg
path: fastpack-macos-aarch64.dmg
- uses: actions/upload-artifact@v4
with:
name: fastpack-macos-x86_64.dmg
path: fastpack-macos-x86_64.dmg
release:
name: release
needs: [build-tauri, build-macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: artifacts/
- name: changelog (nightly)
id: cliff-nightly
if: github.ref == 'refs/heads/master'
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --unreleased --strip header
env:
OUTPUT: CHANGES.md
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: changelog (release)
id: cliff-release
if: startsWith(github.ref, 'refs/tags/v')
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip header
env:
OUTPUT: CHANGES.md
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: nightly release
if: github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
tag: nightly
name: Nightly Build
prerelease: true
allowUpdates: true
removeArtifacts: true
artifacts: "artifacts/*"
body: ${{ steps.cliff-nightly.outputs.content }}
- name: tagged release
if: startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
prerelease: false
allowUpdates: false
artifacts: "artifacts/*"
body: ${{ steps.cliff-release.outputs.content }}