-
Notifications
You must be signed in to change notification settings - Fork 6
154 lines (127 loc) · 5.25 KB
/
publish.yml
File metadata and controls
154 lines (127 loc) · 5.25 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
name: "Publish"
on:
push:
branches:
- master
- release/**
# This workflow will trigger on each push to the `release` branch to create or update a GitHub release, build your app, and upload the artifacts to the release.
jobs:
check-version:
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
outputs:
version: ${{ steps.check-version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
install-deps: false
- name: Check Version
id: check-version
uses: shm11C3/tauri-check-release-version@v1.0.4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
owner: shm11C3
repo: HardwareVisualizer
tauri_config_path: ./src-tauri/tauri.conf.json
tag_name_format: v{VERSION}
publish-tauri:
needs: check-version
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "windows-latest"
args: "--debug"
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: Update tauri.conf.json using Node.js script
run: node .github/scripts/updateTauriConfig.cjs "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@19b93bb55601e3e373a93cfb6eb4242e45f5af20 # v0.6.0
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: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: "v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false
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_${{ needs.check-version.outputs.version }}_x64_en-US_offline.msi"
- if: ${{ matrix.platform == 'windows-latest' }}
name: Upload MSI via gh CLI
run: gh release upload "v${{ needs.check-version.outputs.version }}" 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 "v${{ needs.check-version.outputs.version }}" ./tmp/THIRD_PARTY_NOTICES_${{ matrix.os-name }}.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash