-
-
Notifications
You must be signed in to change notification settings - Fork 331
180 lines (158 loc) · 6.16 KB
/
Copy pathrelease.yml
File metadata and controls
180 lines (158 loc) · 6.16 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
name: Release
on:
push:
tags:
- '*'
permissions:
contents: write
id-token: write
packages: write
env:
CARGO_TERM_COLOR: always
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
release:
strategy:
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'ubuntu-latest'
args: ''
- platform: 'windows-2022'
args: ''
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true
- uses: oven-sh/setup-bun@v2
- name: install dependencies (ubuntu only)
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install CUDA Toolkit (ubuntu only)
uses: Jimver/cuda-toolkit@master
if: startsWith(matrix.platform, 'ubuntu')
with:
cuda: '13.0.0'
log-file-suffix: '${{ matrix.platform }}.txt'
- name: Install CUDA Toolkit (windows only)
uses: Jimver/cuda-toolkit@master
if: startsWith(matrix.platform, 'windows')
with:
cuda: '13.0.0'
method: 'network'
sub-packages: '["nvcc", "cudart", "crt", "thrust", "nvvm", "cublas", "cublas_dev", "cufft", "cufft_dev", "curand", "curand_dev", "nvrtc", "nvrtc_dev"]'
log-file-suffix: '${{ matrix.platform }}.txt'
- name: Install MSVC Build Tools
uses: ilammy/msvc-dev-cmd@v1
if: startsWith(matrix.platform, 'windows')
- name: Install dependencies
run: bun install
- name: Generate release changelog
id: release_notes
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
{
echo 'release_body<<EOF'
bun git-cliff --current --strip all
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Install trusted-signing-cli (windows only)
if: startsWith(matrix.platform, 'windows')
shell: bash
run: |
curl -fsSL "https://github.com/Levminer/trusted-signing-cli/releases/download/0.8.0/trusted-signing-cli.exe" -o "$RUNNER_TEMP/trusted-signing-cli.exe"
printf '%s\n' "$RUNNER_TEMP" >> "$GITHUB_PATH"
"$RUNNER_TEMP/trusted-signing-cli.exe" --version
- name: Import Apple Developer Certificate
if: startsWith(matrix.platform, 'macos')
env:
APPLE_CERTIFICATE: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
APPLE_CERTIFICATE_PASSWORD: ""
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security set-keychain-settings -t 3600 -u build.keychain
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
security find-identity -v -p codesigning build.keychain
- name: Verify Certificate
if: startsWith(matrix.platform, 'macos')
run: |
CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID Application")
CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
echo "Certificate imported."
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM }}
APPLE_CERTIFICATE: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
APPLE_CERTIFICATE_PASSWORD: ""
APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }}
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 }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
with:
tauriScript: npx @tauri-apps/cli
tagName: ${{ github.ref_name }}
releaseName: ${{ github.ref_name }}
releaseBody: ${{ steps.release_notes.outputs.release_body }}
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}
uploadUpdaterJson: true
uploadUpdaterSignatures: true
winget:
needs: release
runs-on: ubuntu-latest
steps:
- uses: vedantmgoyal9/winget-releaser@main
with:
identifier: mayocream.koharu
version: ${{ github.ref_name }}
installers-regex: '(-setup\.exe|\.msi)$'
token: ${{ secrets.WINGET_TOKEN }}
container:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ github.ref_name }}
type=raw,value=latest
- uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}