Repository navigation
105 lines (92 loc) · 3.76 KB
/
Copy pathrelease.yml
File metadata and controls
105 lines (92 loc) · 3.76 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
102
103
104
105
name: Release
on:
# Manual-only. Local `npm run ship` publishes releases (see CLAUDE.md), so the
# tag-push trigger is removed — every `git push --follow-tags` was spinning
# billed macOS runners (matrix.platform = macos-latest ×2) that only failed on
# billing anyway. Run on-demand from the Actions tab if the local ship path is
# ever unavailable (e.g. CI macOS billing gets fixed).
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-preview-${{ github.ref }}
cancel-in-progress: false
jobs:
validate-preview:
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && contains(github.ref_name, '-preview.')
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Require an unpublished preview tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
node --input-type=module <<'JS'
import { readFileSync } from 'node:fs';
import { spawnSync } from 'node:child_process';
import { resolveReleaseChannel } from './scripts/lib/release-channel.mjs';
const { version } = JSON.parse(readFileSync('package.json', 'utf8'));
const policy = resolveReleaseChannel(version, { O8_RELEASE_CHANNEL: 'preview' });
if (process.env.GITHUB_REF_NAME !== policy.tag) throw new Error('Tag and package version differ.');
const result = spawnSync('gh', ['api', `repos/${process.env.GITHUB_REPOSITORY}/releases/tags/${policy.tag}`], { encoding: 'utf8' });
if (result.status === 0) throw new Error('A release already exists; use a fresh preview version.');
if (!result.stderr.includes('HTTP 404')) throw new Error('Could not verify release absence.');
JS
release:
# This fallback only stages explicit preview tags. Stable publication stays
# in the operator-approved local signed release path.
needs: validate-preview
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
args: '--target aarch64-apple-darwin'
target: aarch64-apple-darwin
- platform: macos-latest
args: '--target x86_64-apple-darwin'
target: x86_64-apple-darwin
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install Rust stable
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
targets: ${{ matrix.target }}
- name: Rust cache
uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: './src-tauri -> target'
- name: Install dependencies
run: |
npm install -g npm@11
npm ci
- name: Validate preview version
env:
O8_RELEASE_CHANNEL: preview
run: node scripts/release.mjs --dry-run
- name: Build and release
uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # v0
env:
O8_TAURI_BUILD_TARGET: ${{ matrix.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ''
with:
tagName: v__VERSION__
releaseName: 'o8 v__VERSION__'
releaseBody: 'Preview candidate. Not promoted to stable and not safe for side-by-side use with the daily app.'
releaseDraft: true
prerelease: true
args: ${{ matrix.args }}