-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (79 loc) · 2.33 KB
/
release.yml
File metadata and controls
93 lines (79 loc) · 2.33 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
name: Release
on:
push:
tags:
- "app-v*"
workflow_dispatch:
inputs:
tag:
description: "Release tag to build, for example app-v0.1.0"
required: true
type: string
permissions:
contents: write
env:
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
jobs:
release:
name: Build ${{ matrix.label }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- label: macOS Intel
target: x86_64-apple-darwin
args: --target x86_64-apple-darwin
- label: macOS Apple Silicon
target: aarch64-apple-darwin
args: --target aarch64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Validate release tag
shell: bash
run: |
set -euo pipefail
version="$(node -p "require('./src-tauri/tauri.conf.json').version")"
expected="app-v${version}"
if [[ "${RELEASE_TAG}" != "${expected}" ]]; then
echo "Release tag ${RELEASE_TAG} does not match src-tauri/tauri.conf.json version ${version}."
echo "Expected tag: ${expected}"
exit 1
fi
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache Rust
uses: swatinem/rust-cache@v2
with:
workspaces: src-tauri -> target
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test frontend
run: pnpm test
- name: Typecheck frontend
run: pnpm typecheck
- name: Build and publish Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ env.RELEASE_TAG }}
releaseName: Codex Usage Desktop ${{ env.RELEASE_TAG }}
generateReleaseNotes: true
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}