-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (121 loc) · 4.75 KB
/
tauri.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
name: Tauri
on:
push:
branches:
- 'master'
- 'renovate/*'
tags:
- 'app-v*'
pull_request:
branches:
- 'master'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release-notes:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- name: generate release notes (tag)
id: release_notes
run: |
notes="$(gh api -X POST /repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ github.ref_name }} | yq .body)"
echo 'notes<<EOF' >> $GITHUB_OUTPUT
echo 'A Flatpak repository is also available, see https://github.com/Japan7/karaberus-flatpak' >> $GITHUB_OUTPUT
echo '' >> $GITHUB_OUTPUT
echo "$notes" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
notes: ${{ steps.release_notes.outputs.notes }}
build-tauri:
needs: release-notes
if: ${{ !startsWith(github.ref, 'refs/tags/') || always() }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
target: aarch64-apple-darwin
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
target: x86_64-apple-darwin
- platform: 'ubuntu-22.04'
args: ''
target: x86_64-unknown-linux-gnu
- platform: 'windows-latest'
args: ''
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm' # Set this to npm, yarn or pnpm.
cache-dependency-path: ui/package-lock.json
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: set cargo home (Windows)
if: ${{ startsWith(matrix.platform, 'windows') }}
shell: bash
run: |
echo CARGO_HOME="D:\rust\cargo" >> $GITHUB_ENV
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: 'ui/src-tauri -> target'
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: npm ci # change this to npm or pnpm depending on which one you use.
working-directory: ui
- name: build and publish (tag)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
with:
projectPath: ui
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'App v__VERSION__'
releaseBody: ${{ needs.release-notes.outputs.notes }}
releaseDraft: true
prerelease: false
args: --config ./src-tauri/tauri.release.conf.json ${{ matrix.args }}
- name: build (push)
if: ${{ !startsWith(github.ref, 'refs/tags/') && (github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/')) }}
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
with:
projectPath: ui
args: ${{ matrix.args }}
- name: upload artifact (push)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}_release
path: ui/src-tauri/target/**/release/bundle