-
Notifications
You must be signed in to change notification settings - Fork 73
80 lines (69 loc) · 2.23 KB
/
launcher.yml
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
name: Launcher
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
build_cmd: "build-linux"
arch: "--x64"
- os: windows-latest
build_cmd: "build-win"
arch: "--x64"
steps:
- uses: actions/checkout@v3
with:
# This should fix git rev-list --count HEAD
# https://stackoverflow.com/a/65056108
fetch-depth: 0
path: BYAR-Chobby
- uses: actions/checkout@v3
with:
repository: beyond-all-reason/spring-launcher
path: launcher
- name: Setup NodeJs
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: launcher/package-lock.json
- name: Patch launcher with dist_cfg
run: |
cp -r BYAR-Chobby/dist_cfg/* launcher/src/
for dir in bin files build; do
mkdir -p launcher/$dir
if [ -d launcher/src/$dir/ ]; then
mv launcher/src/$dir/* launcher/$dir/
rm -rf launcher/src/$dir
fi
done
exit 0
- name: Make package.json
run: |
cd BYAR-Chobby
export PACKAGE_VERSION=1.$(git rev-list --count HEAD).0
echo "Making build for version: $PACKAGE_VERSION"
node build/make_package_json.js ../launcher/package.json dist_cfg/config.json $GITHUB_REPOSITORY $PACKAGE_VERSION
- name: Cache electron
uses: actions/cache@v3
with:
path: .electron-cache
key: ${{ runner.os }}-electron-cache-${{ hashFiles('launcher/package.json') }}
restore-keys: |
${{ runner.os }}-electron-cache-
- name: Build
run: |
cd launcher
npm ci
npm run ${{ matrix.build_cmd }} -- ${{ matrix.arch }} --publish always
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ELECTRON_CACHE: ${{ github.workspace }}/.electron-cache/main
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.electron-cache/builder