-
Notifications
You must be signed in to change notification settings - Fork 14
117 lines (102 loc) · 3.43 KB
/
cd.yaml
File metadata and controls
117 lines (102 loc) · 3.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
name: CD
on:
workflow_dispatch:
inputs:
publish:
description: "Publish artifacts from electron-builder"
required: true
default: "never"
type: choice
options:
- never
- always
linux_setup_id:
description: "Config setup ID used to source Linux engine resource"
required: true
default: "latest-linux"
type: string
windows_setup_id:
description: "Config setup ID used to source Windows engine resource"
required: true
default: "latest-win"
type: string
defaults:
run:
shell: bash
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
build_cmd: "build-linux"
arch: "--x64"
platform: "linux"
- os: windows-latest
build_cmd: "build-win"
arch: "--x64"
platform: "win32"
steps:
- uses: actions/checkout@v6
with:
# This should fix git rev-list --count HEAD
# https://stackoverflow.com/a/65056108
fetch-depth: 0
submodules: recursive
path: repo-folder
- uses: actions/checkout@v6
with:
repository: gajop/spring-launcher
submodules: recursive
path: spring-launcher
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"
- name: Prepare folder structure
run: |
mkdir build
cp spring-launcher/* -r build/
cp repo-folder/dist_cfg/* -r build/src/
mkdir -p build/{bin,files,build}
[ -d build/src/bin/ ] && mv build/src/bin/* build/bin/
[ -d build/src/files/ ] && mv build/src/files/* build/files/
[ -d build/src/build/ ] && mv build/src/build/* build/build/
rm -rf build/src/{bin,files,build}
tree -a -L 3 build
- name: Prepare packaged assets
run: |
GIT_HASH=$(git -C repo-folder rev-parse --short=12 HEAD)
PACKAGE_VERSION=1.$(git -C repo-folder rev-list --count HEAD).0
uv run --project ./repo-folder/build --locked sbc-packager-package \
--repo-root ./repo-folder \
--config-in ./repo-folder/dist_cfg/config.json \
--config-out ./build/src/config.json \
--files-dir ./build/files \
--meta-out ./build/build/package-assets.json \
--package-json ./build/package.json \
--repo-full-name Spring-SpringBoard/SpringBoard-Core \
--platform "${{ matrix.platform }}" \
--git-hash "$GIT_HASH" \
--package-version "$PACKAGE_VERSION" \
--linux-setup-id "${{ github.event.inputs.linux_setup_id }}" \
--windows-setup-id "${{ github.event.inputs.windows_setup_id }}"
cat build/package.json
- name: Build
run: |
cd build
npm install
npm run ${{ matrix.build_cmd }} -- ${{ matrix.arch }} --publish "${{ github.event.inputs.publish }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build artifacts
uses: actions/upload-artifact@v6
with:
name: springboard-${{ matrix.platform }}-bundle
path: build/dist/**
if-no-files-found: error