-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (104 loc) · 3.3 KB
/
Copy pathrelease.yml
File metadata and controls
108 lines (104 loc) · 3.3 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
name: Release
on:
push:
tags:
- v*
workflow_dispatch:
permissions:
contents: write
jobs:
package:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
args: --win
- os: macos-latest
args: --mac
- os: ubuntu-latest
args: --linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: pnpm/setup@v2
with:
# 22.13 起才开放 node:sqlite;22.12 导入会报 No such built-in module。
runtime: node@22.13.0
cache: true
require-lockfile: true
- name: Check release tag matches package version
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
expected="v$(node -p "require('./package.json').version")"
if [ "${GITHUB_REF_NAME}" != "${expected}" ]; then
echo "Tag ${GITHUB_REF_NAME} does not match package.json ${expected}"
exit 1
fi
node scripts/extract-changelog.mjs release-notes.md
- run: pnpm test
- run: pnpm exec vite build
- run: pnpm exec electron-builder ${{ matrix.args }} --publish never
env:
CSC_IDENTITY_AUTO_DISCOVERY: "false"
- name: Check updater manifests
shell: bash
run: |
case "${{ matrix.os }}" in
windows-latest)
# Windows NSIS 只写 latest.yml(多架构列在同一文件),没有 latest-arm64.yml。
test -f release/*/latest.yml
ls release/*/*-Setup.exe
;;
ubuntu-latest)
test -f release/*/latest-linux.yml
test -f release/*/latest-linux-arm64.yml
ls release/*/*.AppImage
ls release/*/*.deb
;;
macos-latest)
test -f release/*/latest-mac.yml
;;
esac
- uses: actions/upload-artifact@v4
with:
name: stackferry-${{ matrix.os }}
path: |
release/*/*-Setup.exe
release/*/*.dmg
release/*/*.AppImage
release/*/*.deb
release/*/latest*.yml
release/*/*.blockmap
if-no-files-found: error
publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Extract changelog
run: node scripts/extract-changelog.mjs release-notes.md
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- uses: softprops/action-gh-release@v2
with:
files: artifacts/**
body_path: release-notes.md
generate_release_notes: true
draft: false
prerelease: false
make_latest: "true"
- name: Attach Tauri trampoline latest.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
if gh release download v0.1.28 --pattern latest.json --dir trampoline-manifest; then
gh release upload "${GITHUB_REF_NAME}" trampoline-manifest/latest.json --clobber
else
echo "v0.1.28 latest.json is not on GitHub yet; attach it after the Tauri trampoline ships."
fi