-
Notifications
You must be signed in to change notification settings - Fork 12
78 lines (64 loc) · 1.99 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
name: Launcher
on:
push:
paths:
- 'dist_cfg/**'
# 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-20.04
build_cmd: "build-linux"
arch: "--x64"
- os: windows-latest
build_cmd: "build-win"
arch: "--x64"
steps:
- uses: actions/checkout@v2
with:
# This should fix git rev-list --count HEAD
# https://stackoverflow.com/a/65056108
fetch-depth: 0
path: repo-folder
- uses: actions/checkout@v2
with:
repository: gajop/spring-launcher
path: spring-launcher
- name: Setup NodeJs
uses: actions/setup-node@v1
with:
node-version: '17.x'
- 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}
find build/
exit 0
- name: Make package.json
run: |
cd repo-folder
export PACKAGE_VERSION=1.$(git rev-list --count HEAD).0
echo "Making build for version: $PACKAGE_VERSION"
cd ..
node ./repo-folder/build/make_package_json.js build/package.json repo-folder/dist_cfg/config.json Spring-SpringBoard/SpringBoard-Core $PACKAGE_VERSION
cat build/package.json
- name: Build
run: |
cd build
npm install
npm run ${{ matrix.build_cmd }} -- ${{ matrix.arch }} --publish always
env:
GH_TOKEN: ${{ secrets.github_token }}