-
-
Notifications
You must be signed in to change notification settings - Fork 10
176 lines (172 loc) · 6.87 KB
/
release.yml
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
name: distributions release
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
pre-release:
strategy:
fail-fast: false
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
include:
- os: 'macos-latest'
args: '--target universal-apple-darwin'
target: 'aarch64-apple-darwin,x86_64-apple-darwin'
- os: 'windows-latest'
args: '--target aarch64-pc-windows-msvc'
target: 'aarch64-pc-windows-msvc'
aarch64: true
- os: 'windows-latest'
args: '--target x86_64-pc-windows-msvc'
target: 'x86_64-pc-windows-msvc'
x86_64: true
- os: 'ubuntu-latest'
args: '--target aarch64-unknown-linux-gnu'
target: 'aarch64-unknown-linux-gnu'
aarch64: true
- os: 'ubuntu-latest'
args: '--target x86_64-unknown-linux-gnu'
target: 'x86_64-unknown-linux-gnu'
x86_64: true
node-version: [ 20.x ]
runs-on: ${{ matrix.os }}
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf pkg-config libssl-dev gcc-aarch64-linux-gnu
- name: install frontend dependencies
run: npm ci --legacy-peer-deps
- run: npm run lint:check
- run: npm audit --audit-level=critical
- run: npm run test:ci
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- run: npm run build
# - name: Generate changelog
# uses: jaywcjlove/changelog-generator@main
# id: changelog
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# - name: import windows certificate
# if: matrix.os == 'windows-latest'
# env:
# WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
# WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
# run: |
# New-Item -ItemType directory -Path certificate
# Set-Content -Path certificate/tempCert.txt -Value $env:WINDOWS_CERTIFICATE
# certutil -decode certificate/tempCert.txt certificate/certificate.pfx
# Remove-Item -path certificate -include tempCert.txt
# Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText)
# - name: Tag Release
# uses: jaywcjlove/create-tag-action@main
# id: tag_release
# with:
# prerelease: true
# token: ${{ secrets.GITHUB_TOKEN }}
# body: |
# ${{ steps.changelog.outputs.compareurl }}
#
# ${{ steps.changelog.outputs.changelog }}
- name: Build Distribution Artifacts
uses: tauri-apps/tauri-action@v0
# if: steps.tag_release.outputs.successful
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PKG_CONFIG_ALLOW_CROSS: 1
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
# APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
with:
# tagName: ${{ steps.tag_release.outputs.version }}
# releaseName: ${{ steps.tag_release.outputs.version }}
# appVersion: "${{ steps.tag_release.outputs.versionNumber }}"
args: ${{ matrix.args }}
# releaseBody: |
# ${{ steps.changelog.outputs.compareurl }}
#
# ${{ steps.changelog.outputs.changelog }}
#
# releaseDraft: true
# prerelease: true
- name: Sign files with Trusted Signing
if: matrix.os == 'windows-latest'
uses: azure/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://eus.codesigning.azure.net/
trusted-signing-account-name: geek-fun
certificate-profile-name: geek-fun
files-folder: ${{ github.workspace }}\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\
files-folder-depth: 7
files-folder-filter: exe
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Upload Distribution Artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.os }}
path: |
src-tauri/target/**/*.{dmg,rpm,deb}
src-tauri/target/**/*?{setup.exe}
release:
needs: pre-release
runs-on: ubuntu-latest
steps:
- name: Download Distribution Artifacts
uses: actions/download-artifact@v4
with:
path: src-tauri/target
merge-multiple: true
- name: Generate changelog
uses: jaywcjlove/changelog-generator@main
id: changelog
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Release App
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.chnagelog.outputs.tag }}
name: ${{ steps.chnagelog.outputs.version }}
body: |
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
files: |
src-tauri/target/**/*
# - name: Distribute artifacts to R2
# uses: ryand56/r2-upload-action@master
# if: steps.tag_release.outputs.successful
# with:
# r2-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# r2-access-key-id: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
# r2-secret-access-key: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
# r2-bucket: ${{ secrets.CLOUDFLARE_ARTIFACTS_R2 }}
# source-dir: src-tauri/target/**/*
# destination-dir: dockit