-
Notifications
You must be signed in to change notification settings - Fork 27
178 lines (174 loc) · 5.66 KB
/
canary.yaml
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
name: "Canary"
on:
workflow_dispatch:
inputs:
branch:
description: Select branch
required: true
default: main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install
run: pnpm install
- name: Check format
run: pnpm check:format
- name: Lint
run: pnpm lint
build-tauri:
name: Build (${{ matrix.settings.os }})
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: universal-apple-darwin
toolchain: aarch64-apple-darwin,x86_64-apple-darwin
bundles: dmg
os: mac
- host: windows-latest
target: x86_64-pc-windows-msvc
toolchain: x86_64-pc-windows-msvc
bundles: nsis
os: windows
- host: ubuntu-22.04
target: x86_64-unknown-linux-gnu
toolchain: x86_64-unknown-linux-gnu
bundles: deb,appimage
os: linux
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
target: "${{ matrix.settings.toolchain }}"
- uses: Swatinem/rust-cache@v2
with:
workspaces: "apps/desktop/src-tauri/target"
- name: Install dependencies (ubuntu only)
if: matrix.settings.host == 'ubuntu-22.04'
run: |
# https://tauri.app/v1/guides/building/linux/#limitations
sudo apt-get update
sudo apt install \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
libwebkit2gtk-4.1-dev \
librsvg2-dev
- name: Install dependencies
run: pnpm install
- name: Patch canary version
uses: actions/github-script@v7
with:
script: |
const path = require("path");
const { script } = await import("file://" + path.resolve('./scripts/actions/patch-canary-version.js'));
await script({ github, context });
- uses: tauri-apps/tauri-action@dev
id: build_os
with:
projectPath: apps/desktop
args: --config "src-tauri/tauri.conf.canary.json" --target ${{ matrix.settings.target }} --bundles ${{ matrix.settings.bundles }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: "${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}"
TAURI_SIGNING_PUBLIC_KEY: "${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}"
VITE_AXIOM_TOKEN: "${{ secrets.VITE_AXIOM_TOKEN }}"
- name: Upload canary ${{ matrix.setting.os }}
uses: actions/upload-artifact@v4
with:
name: "overlayed-canary-${{ matrix.settings.os }}"
path: "${{ join(fromJSON(steps.build_os.outputs.artifactPaths), '\n') }}"
upload-to-r2:
needs: build-tauri
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 9
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install
run: pnpm install --filter=overlayed-root
- name: Upload Canary Binary to R2
uses: actions/github-script@v7
with:
script: |
const path = require("path");
const { script } = await import("file://" + path.resolve('./scripts/actions/upload-to-r2.js'));
await script({ github, context }, "canary" );
env:
R2_BUCKET: ${{ secrets.R2_BUCKET }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}