-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (126 loc) · 4.06 KB
/
Copy pathrelease.yml
File metadata and controls
148 lines (126 loc) · 4.06 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
name: Release
on:
push:
tags:
- "v*"
- "!v*dev*"
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
create-release:
name: Create draft release
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.release.outputs.release_id }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2
with:
cache: false
- name: Create or find draft release
id: release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cargo x create-release
build:
name: Build (${{ matrix.name }})
needs: create-release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux x86_64
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- name: macOS aarch64
os: macos-latest
target: aarch64-apple-darwin
- name: macOS x86_64
os: macos-latest
target: x86_64-apple-darwin
- name: Windows x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --yes \
libappindicator3-dev \
librsvg2-dev \
libwebkit2gtk-4.1-dev \
patchelf \
xdg-utils
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2
with:
target: ${{ matrix.target }}
cache-key: release-${{ matrix.target }}
- name: Install Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm
cache-dependency-path: crates/wizard/ff-wizard-ui/package-lock.json
- name: Install frontend dependencies
working-directory: crates/wizard/ff-wizard-ui
run: npm ci
- name: Build frontend
working-directory: crates/wizard/ff-wizard-ui
run: npm run build
- name: Build and stage release bundles
shell: bash
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: >-
cargo x release-build
--target ${{ matrix.target }}
--output release-assets
- name: Upload release bundles
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "$GITHUB_REF_NAME" release-assets/* --clobber
generate-latest-json:
name: Generate updater metadata
needs:
- create-release
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2
with:
cache: false
- name: Generate and upload latest.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: ${{ needs.create-release.outputs.release_id }}
run: >-
cargo x latest-json
--repository "$GITHUB_REPOSITORY"
--release-id "$RELEASE_ID"
publish-release:
name: Publish
needs:
- create-release
- generate-latest-json
runs-on: ubuntu-latest
steps:
- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: ${{ needs.create-release.outputs.release_id }}
run: >-
gh api --method PATCH
"repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}"
-F draft=false