-
-
Notifications
You must be signed in to change notification settings - Fork 6
95 lines (87 loc) · 2.93 KB
/
Copy pathrelease.yml
File metadata and controls
95 lines (87 loc) · 2.93 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
name: Release
on:
push:
tags:
- "v*"
jobs:
# Create the draft release once, up front, so the parallel build jobs all
# upload to the same release instead of each creating a duplicate draft.
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
release_id: ${{ steps.create.outputs.result }}
steps:
- uses: actions/github-script@v7
id: create
with:
script: |
const { data } = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: process.env.GITHUB_REF_NAME,
name: `YAKC ${process.env.GITHUB_REF_NAME}`,
draft: true,
prerelease: false,
});
return data.id;
bundle:
needs: create-release
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04 # Linux x64: deb, rpm, AppImage
args: ""
rust-targets: ""
- os: ubuntu-24.04-arm # Linux arm64
args: ""
rust-targets: ""
- os: windows-latest # Windows x64: msi, nsis
args: ""
rust-targets: ""
- os: windows-11-arm # Windows arm64
args: ""
rust-targets: ""
# One universal macOS build runs on both Intel and Apple Silicon,
# so no (retired) Intel runner is needed.
- os: macos-latest
args: "--target universal-apple-darwin"
rust-targets: "aarch64-apple-darwin,x86_64-apple-darwin"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Linux dependencies
if: runner.os == 'Linux'
# Retry: the ARM package mirror (ports.ubuntu.com) is occasionally
# unreachable from the runners, which is transient.
run: |
for attempt in 1 2 3 4 5; do
sudo apt-get update && sudo apt-get install -y \
libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf \
libxkbcommon-dev libspeechd-dev libudev-dev && exit 0
echo "apt attempt $attempt failed; retrying in 20s"; sleep 20
done
echo "apt failed after 5 attempts"; exit 1
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust-targets }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Build and upload release bundles
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.create-release.outputs.release_id }}
args: ${{ matrix.args }}
# Fail the run visibly if any platform bundle failed.
finish:
needs: bundle
runs-on: ubuntu-latest
steps:
- run: echo "All platform bundles uploaded to the draft release."