-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (85 loc) · 3.08 KB
/
release.yml
File metadata and controls
101 lines (85 loc) · 3.08 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
name: Release
# Triggered by pushing a tag like `v0.1.0`. Builds the Tauri app on macOS and
# Windows in parallel, then publishes a GitHub Release with the artifacts.
#
# To cut a release locally:
# 1. Bump `version` in app/src-tauri/tauri.conf.json AND
# app/src-tauri/Cargo.toml AND app/package.json (kept in sync).
# 2. git commit -am "release: v0.1.0"
# 3. git tag v0.1.0 && git push && git push --tags
#
# Workflow_dispatch is also wired up so you can rebuild on demand (e.g. to
# regenerate artifacts after a CI fix) without recutting a tag.
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
args: --target universal-apple-darwin
rust-targets: aarch64-apple-darwin,x86_64-apple-darwin
- platform: windows-latest
args: ''
rust-targets: ''
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
# pnpm before setup-node so the latter can wire up `cache: pnpm` against
# the store path that pnpm just installed.
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: app/pnpm-lock.yaml
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust-targets }}
- name: Cache cargo registry + build
uses: Swatinem/rust-cache@v2
with:
workspaces: app/src-tauri -> target
- name: Install frontend deps
working-directory: app
run: pnpm install --frozen-lockfile
# Tauri action: builds the bundles for the current platform and uploads
# them to a GitHub Release named after the tag. `releaseDraft: false`
# publishes immediately; flip to `true` if you want to review before
# making the release public.
- name: Build + publish
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: app
tagName: ${{ github.ref_name }}
releaseName: 'Xhare ${{ github.ref_name }}'
releaseBody: |
Xhare release ${{ github.ref_name }}.
### Downloads
- **macOS**: `.dmg` (universal — Intel + Apple Silicon)
- **Windows**: `.exe` (NSIS installer, no admin required)
⚠️ This build is **unsigned**.
**macOS first launch:** double-click will be blocked. Open
**System Settings → Privacy & Security**, scroll down, and click
**"Open Anyway"** next to the Xhare entry. First time only.
**Windows first launch:** SmartScreen may warn. Click **"More
info"** → **"Run anyway"**.
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}