Repository navigation
74 lines (69 loc) · 2.37 KB
/
Copy pathlinux-release.yml
File metadata and controls
74 lines (69 loc) · 2.37 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
name: Release
on:
push:
tags:
- "v[0-9]*.[0-9]*.[0-9]*"
permissions:
contents: read
jobs:
validate:
name: Validate release metadata
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
- run: node scripts/check-release.mjs "$GITHUB_REF_NAME"
build:
needs: validate
uses: ./.github/workflows/desktop-builds.yml
secrets: inherit
publish:
name: Publish verified desktop binaries
needs: build
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
- uses: actions/download-artifact@v4
with:
pattern: utterform-binaries-*
path: release
merge-multiple: true
- name: Verify asset set and create combined checksums
run: |
for asset in utterform-linux-x86_64-system.tar.gz install-linux.sh utterform-windows-x86_64.exe utterform-windows-x86_64-setup.exe install-windows.ps1 utterform-macos-aarch64.dmg utterform-macos-aarch64.app.zip; do
test -s "release/$asset" || { echo "Missing asset: $asset"; exit 1; }
done
node scripts/checksums.mjs release
cd release
sha256sum -c SHA256SUMS.txt
- name: Publish release after every platform passed
env:
GH_TOKEN: ${{ github.token }}
run: |
notes="docs/releases/${GITHUB_REF_NAME}.md"
test -f "$notes"
read -r title < "$notes"
title="${title#\# }"
# The notes file opens with the title as a heading, for the docs.
# GitHub shows the title above the body itself, so publishing the
# file as-is put it there twice. Publish the body without it.
body="$(mktemp)"
tail -n +2 "$notes" | sed '1{/^$/d}' > "$body"
flags=()
latest=true
if [[ "$GITHUB_REF_NAME" == *-* ]]; then
flags+=(--prerelease)
latest=false
fi
gh release create "$GITHUB_REF_NAME" release/* \
--repo "$GITHUB_REPOSITORY" \
--verify-tag --draft "${flags[@]}" \
--title "$title" --notes-file "$body"
gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --draft=false --latest="$latest"