Repository navigation
61 lines (61 loc) · 1.9 KB
/
Copy pathrelease-builds.yml
File metadata and controls
61 lines (61 loc) · 1.9 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
name: Build release installers
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: windows
- os: ubuntu-latest
target: linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run build
- name: Build Windows NSIS installer
if: matrix.target == 'windows'
run: npx electron-builder --win nsis --x64 --publish never
- name: Build Ubuntu DEB and RPM installers
if: matrix.target == 'linux'
run: npx electron-builder --linux deb rpm --x64 --publish never
- uses: actions/upload-artifact@v4
with:
name: installers-${{ matrix.target }}
path: release/*
if-no-files-found: error
retention-days: 30
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: installers
merge-multiple: true
- name: Ensure release exists
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1 || \
gh release create "$TAG" --repo "$GITHUB_REPOSITORY" \
--title "Python 符文纪事 $TAG" \
--notes "32 关、160 道知识试炼的 Python 教学像素 RPG。macOS DMG 将在本地签名、公证服务恢复后补充发布。"
- env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
gh release upload "$TAG" installers/*.exe installers/*.deb installers/*.rpm \
--repo "$GITHUB_REPOSITORY" \
--clobber