-
Notifications
You must be signed in to change notification settings - Fork 6
219 lines (182 loc) · 7.36 KB
/
publish.yml
File metadata and controls
219 lines (182 loc) · 7.36 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
name: "Publish"
on:
push:
tags:
- "v*"
workflow_dispatch: {}
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "windows-latest"
args: ""
os-name: "windows"
- platform: "ubuntu-22.04"
args: ""
os-name: "linux"
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
uses: ./.github/actions/setup-linux-deps
with:
extra-packages: "libfuse2 libappindicator3-dev patchelf"
- name: Fix linuxdeploy permissions
if: matrix.platform == 'ubuntu-22.04'
run: chmod +x ./src-tauri/target/release/bundle/appimage/linuxdeploy-*.AppImage || true
- name: Unset problematic env vars
if: matrix.platform == 'ubuntu-22.04'
run: |
unset GTK_PATH
unset LD_LIBRARY_PATH
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
setup-safe-chain: false
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
components: ""
- name: Generate licenses.json
run: npx license-checker --production --json > licenses.json
- name: Check licenses
run: node --experimental-strip-types .github/scripts/check-licenses.ts licenses.json
- name: Export VERSION for later steps
shell: bash
run: |
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Update tauri.conf.json using Node.js script
shell: bash
run: |
TAG="${GITHUB_REF_NAME}" # v1.x.x
node .github/scripts/update-tauri-config.ts \
--tag "$TAG" \
--sign "trusted-signing-cli -e https://eus.codesigning.azure.net/ -a hardware-monitor -c hv-certificate %1"
- name: Setup Azure Code Signing
run: cargo install trusted-signing-cli
# Generate THIRD_PARTY_LICENSES file
# Generate here to include in Tauri build bundle
- name: Install cargo-license
run: cargo install cargo-license
- name: Generate THIRD_PARTY_NOTICES
run: node --experimental-strip-types .github/scripts/generate-licenses.ts tmp
- uses: tauri-apps/tauri-action@73fb865345c54760d875b94642314f8c0c894afa # v0.6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: ${{ github.ref_name }}
releaseName: ${{ github.ref_name }}
releaseDraft: true
prerelease: ${{ contains(github.ref_name, '-') }}
args: ${{ matrix.args }}
- if: ${{ matrix.platform == 'windows-latest' }}
name: Bundle Offline Installer
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: npm run tauri bundle -- --config src-tauri/tauri.microsoftstore.conf.json
shell: bash
- if: ${{ matrix.platform == 'windows-latest' }}
name: Rename Offline Installer
run: |
mkdir -p dist/offline
cp src-tauri/target/release/bundle/msi/*.msi "dist/offline/HardwareVisualizer_${VERSION}_x64_en-US_offline.msi"
- if: ${{ matrix.platform == 'windows-latest' }}
name: Upload MSI via gh CLI
run: gh release upload "${{ github.ref_name }}" dist/offline/*.msi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: Upload THIRD_PARTY_NOTICES.md
run: |
mv ./tmp/THIRD_PARTY_NOTICES.md ./tmp/THIRD_PARTY_NOTICES_${{ matrix.os-name }}.md
gh release upload "${{ github.ref_name }}" ./tmp/THIRD_PARTY_NOTICES_${{ matrix.os-name }}.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
publish-tauri-macos:
if: ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
os-name: 'macos-aarch64'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
os-name: 'macos-x64'
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
setup-safe-chain: false
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
targets: "aarch64-apple-darwin x86_64-apple-darwin"
- name: Generate licenses.json
run: npx license-checker --production --json > licenses.json
- name: Check licenses
run: node --experimental-strip-types .github/scripts/check-licenses.ts licenses.json
- name: Export VERSION for later steps
shell: bash
run: |
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Update tauri.conf.json using Node.js script
shell: bash
run: |
TAG="${GITHUB_REF_NAME}" # v1.x.x
node .github/scripts/update-tauri-config.ts \
--tag "$TAG" \
--sign ""
# Generate THIRD_PARTY_LICENSES file
# Generate here to include in Tauri build bundle
- name: Cache cargo-license binary
id: cache-cargo-license
uses: actions/cache@v5
with:
path: ~/.cargo/bin/cargo-license
key: cargo-license-${{ runner.os }}-v1
- name: Install cargo-license
if: steps.cache-cargo-license.outputs.cache-hit != 'true'
run: cargo install cargo-license
- name: Generate THIRD_PARTY_NOTICES
run: node --experimental-strip-types .github/scripts/generate-licenses.ts tmp
- uses: tauri-apps/tauri-action@73fb865345c54760d875b94642314f8c0c894afa # v0.6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: ${{ github.ref_name }}
releaseName: ${{ github.ref_name }}
releaseDraft: true
prerelease: true
args: ${{ matrix.args }}
- name: Upload THIRD_PARTY_NOTICES.md
run: |
mv ./tmp/THIRD_PARTY_NOTICES.md ./tmp/THIRD_PARTY_NOTICES_${{ matrix.os-name }}.md
gh release upload "${{ github.ref_name }}" ./tmp/THIRD_PARTY_NOTICES_${{ matrix.os-name }}.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash