forked from lichess-org/broadcaster
-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (127 loc) · 5.93 KB
/
tauri-publish.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
name: 'Build'
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-22.04
target: x86_64-unknown-linux-gnu
bundles: appimage,deb
- platform: macos-latest
target: universal-apple-darwin
bundles: app,dmg
- platform: windows-latest
target: x86_64-pc-windows-msvc
bundles: msi
runs-on: ${{ matrix.platform }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
RELEASE_VERSION: ${{ steps.tauri-build.outputs.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: tauri build
id: tauri-build
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
shell: bash
run: |
pnpm tauri build --ci --target ${{ matrix.target }} --bundles ${{ matrix.bundles }},updater
echo "RELEASE_VERSION=v$(pnpm pkg get version | tr -d \")" >> $GITHUB_OUTPUT
- name: set filenames
shell: bash
run: |
mkdir artifacts
cp src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage artifacts/Lichess-Broadcaster-linux.AppImage || true
cp src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.tar.gz artifacts/Lichess-Broadcaster-linux.AppImage.tar.gz || true
cp src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.tar.gz.sig artifacts/Lichess-Broadcaster-linux.AppImage.tar.gz.sig || true
cp src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb artifacts/Lichess-Broadcaster-linux.deb || true
cp src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg artifacts/Lichess-Broadcaster-macos.dmg || true
cp src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app.tar.gz artifacts/Lichess-Broadcaster-macos.app.tar.gz || true
cp src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app.tar.gz.sig artifacts/Lichess-Broadcaster-macos.app.tar.gz.sig || true
cp src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi artifacts/Lichess-Broadcaster-windows.msi || true
- name: upload artifact (windows unsigned msi)
id: upload-unsigned-artifact
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: windows-unsigned-msi
path: artifacts/Lichess-Broadcaster-windows.msi
- name: code signing (windows)
id: code-signing
if: matrix.platform == 'windows-latest'
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: '5f88bd6d-9f02-4053-af25-77474c4957e8'
project-slug: 'broadcaster'
signing-policy-slug: ${{ startsWith(github.ref, 'refs/tags/v') && 'release-signing' || 'test-signing' }}
github-artifact-id: ${{ steps.upload-unsigned-artifact.outputs.artifact-id }}
wait-for-completion: true
output-artifact-directory: 'artifacts'
- name: zip msi for auto-updater (windows)
if: matrix.platform == 'windows-latest'
shell: pwsh
run: Compress-Archive -Path artifacts/Lichess-Broadcaster-windows.msi -DestinationPath artifacts/Lichess-Broadcaster-windows.msi.zip -CompressionLevel NoCompression
- name: generate updater signature (windows)
if: matrix.platform == 'windows-latest'
shell: bash
run: pnpm tauri signer sign --private-key "${{ secrets.TAURI_PRIVATE_KEY }}" --password "${{ secrets.TAURI_PRIVATE_KEY_PASSWORD }}" artifacts/Lichess-Broadcaster-windows.msi.zip
- name: upload release artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.platform }}-${{ matrix.target}}
path: artifacts
publish:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs: build
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: geekyeggo/delete-artifact@v5
with:
name: windows-unsigned-msi
- name: download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: prepare the release files
run: |
mkdir release-files
find artifacts -type f -exec mv {} release-files \;
- name: publish release (if not exists)
run: |
gh release view ${{ needs.build.outputs.RELEASE_VERSION }} || \
gh release create ${{ needs.build.outputs.RELEASE_VERSION }} \
--title "${{ needs.build.outputs.RELEASE_VERSION }}" \
--verify-tag \
--latest \
release-files/*