-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (134 loc) · 5.43 KB
/
Copy pathbeta.yml
File metadata and controls
153 lines (134 loc) · 5.43 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
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
name: Beta
run-name: "OpenVCS Beta • Run #${{ github.run_number }} • Beta@${{ github.sha }}"
on:
push:
branches: [ Beta ]
workflow_dispatch:
concurrency:
group: openvcs-beta
cancel-in-progress: true
permissions:
contents: write
actions: write
env:
TARGET_REF: Beta
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: ${{ vars.SSCCACHE_GHA_ENABLED }}
SCCACHE_CACHE_SIZE: ${{ vars.SSCCACHE_SIZE }}
jobs:
prepare-release:
name: Clean existing rolling release
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Remove existing 'openvcs-beta' release & tag
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const tag = 'openvcs-beta';
const releases = await github.paginate(github.rest.repos.listReleases, { owner, repo, per_page: 100 });
const rel = releases.find(r => r.tag_name === tag);
if (rel) await github.rest.repos.deleteRelease({ owner, repo, release_id: rel.id });
try {
await github.rest.git.deleteRef({ owner, repo, ref: `tags/${tag}` });
} catch (e) {
if (e.status !== 422) throw e;
}
beta:
name: Build & publish Beta
needs: prepare-release
strategy:
fail-fast: true
matrix:
include:
- platform: ubuntu-24.04
args: ''
- platform: windows-latest
args: ''
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout target ref
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ env.TARGET_REF }}
fetch-depth: 0
lfs: true
- name: Compute metadata (date, short SHA)
id: meta
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const date = new Date().toISOString().slice(0, 10);
const short = context.sha.substring(0, 7);
core.setOutput('short_sha', short);
core.setOutput('date', date);
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: Frontend/package-lock.json
- name: Install frontend deps
working-directory: Frontend
run: npm ci
- name: Build frontend
working-directory: Frontend
env:
VITE_SENTRY_ENVIRONMENT: beta
VITE_SENTRY_RELEASE: openvcs-beta-${{ steps.meta.outputs.short_sha }}
SENTRY_AUTH_TOKEN: ${{ matrix.platform == 'ubuntu-24.04' && secrets.SENTRY_AUTH_TOKEN || '' }}
SENTRY_ORG: ${{ matrix.platform == 'ubuntu-24.04' && secrets.SENTRY_ORG || '' }}
SENTRY_PROJECT: ${{ matrix.platform == 'ubuntu-24.04' && secrets.SENTRY_PROJECT || '' }}
run: npm run build
- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
with:
components: rustfmt, clippy
- name: Setup sccache
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- name: Install Linux deps
if: matrix.platform == 'ubuntu-24.04'
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libwebkit2gtk-4.1-dev || sudo apt-get install -y libwebkit2gtk-4.0-dev
- name: Rust cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
cache-on-failure: true
- name: Cargo fmt (check)
run: cargo fmt --all -- --check
- name: Cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: Patch version for beta prerelease
run: node scripts/bump-tauri-version.js beta
- name: Write channel Tauri config override
env:
OPENVCS_UPDATE_CHANNEL: beta
run: node scripts/write-tauri-channel-config.js "${{ runner.temp }}/tauri.channel.conf.json"
- name: Build and publish Beta prerelease
uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # action-v0.6.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FRONTEND_SKIP_BUILD: '1'
OPENVCS_UPDATE_CHANNEL: beta
OPENVCS_SENTRY_DSN: ${{ secrets.OPENVCS_SENTRY_DSN }}
OPENVCS_SENTRY_ENVIRONMENT: beta
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_PRIVATE_KEY_PASSWORD }}
with:
projectPath: Backend
tagName: openvcs-beta
releaseName: "OpenVCS Beta ${{ steps.meta.outputs.date }} (${{ env.TARGET_REF }}@${{ steps.meta.outputs.short_sha }})"
releaseBody: |
Beta build from `${{ env.TARGET_REF }}`.
Date (UTC): ${{ steps.meta.outputs.date }}
Commit: ${{ github.sha }} (${{ env.TARGET_REF }}@${{ steps.meta.outputs.short_sha }})
Runner: ${{ runner.os }} • Run #${{ github.run_number }}
releaseDraft: true
prerelease: true
args: ${{ format('{0} --config {1}/tauri.channel.conf.json', matrix.args || '', runner.temp) }}