Repository navigation
58 lines (49 loc) · 2.08 KB
/
Copy pathrelease.yml
File metadata and controls
58 lines (49 loc) · 2.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
# Builds every package from a version tag on a clean GitHub-hosted runner, signs SHA256SUMS
# (Ed25519; required by the in-app updater), signs SLSA build provenance for each file
# (Sigstore, verifiable with `gh attestation verify`) and publishes the release. The landing
# page reads the latest release from GitHub's API, so it needs no update here.
name: release
on:
push:
tags: ["v*"]
permissions:
contents: read
jobs:
build:
runs-on: macos-15 # Apple silicon: builds the macOS apps (Swift + WebKit) and the Linux packages
permissions:
contents: write # create the GitHub release
id-token: write # sign attestations
attestations: write
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.4
- name: Tag matches package.json
run: |
v=$(bun -e 'console.log(require("./package.json").version)')
test "v$v" = "$GITHUB_REF_NAME" || { echo "tag $GITHUB_REF_NAME != package.json $v"; exit 1; }
- run: bun run test
# Pinned browser for the Linux packages is verified against packaging/browser-pins.json.
- run: bun run build
# The in-app updater only installs releases whose SHA256SUMS carries this signature.
- name: Sign SHA256SUMS
env:
CODEVIEWER_UPDATE_KEY: ${{ secrets.CODEVIEWER_UPDATE_KEY }}
run: bun scripts/sign.ts dist/release/SHA256SUMS
- name: Attest build provenance
uses: actions/attest-build-provenance@v4
with:
subject-path: dist/release/*
- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
run: |
# The notes are the release commit's summary paragraph (HEAD of the checked-out tag),
# written outside dist/release so they are not uploaded as an asset.
bun scripts/release-notes.ts > "$RUNNER_TEMP/release-notes.md"
gh release create "$GITHUB_REF_NAME" dist/release/* \
--verify-tag \
--title "Codeviewer $GITHUB_REF_NAME" \
--notes-file "$RUNNER_TEMP/release-notes.md"