-
Notifications
You must be signed in to change notification settings - Fork 5
60 lines (51 loc) · 1.67 KB
/
update-compiler.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
name: update effekt compiler
on:
# can only be triggered manually
workflow_dispatch:
inputs:
effekt_commit:
description: "Commit SHA of Effekt submodule to checkout and build. If omitted, the latest commit is chosen. (OPTIONAL)"
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Scala & sbt
uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
- name: Setup nodejs
uses: actions/setup-node@v4
with:
node-version: 16
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Update submodule
run: |
git -C effekt/ checkout master
git -C effekt/ pull
if [ -n "$effekt_commit" ]; then
git -C effekt/ checkout ${{ github.event.inputs.effekt_commit }}
fi
- name: Build Effekt JS
run: |
cd effekt/
sbt assembleJS
cp -f out/effekt.js ../src/effekt.js
- name: Run webpack
run: |
npm install
npx webpack
- name: Commit updated compiler and submodule update
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add src/ dist/ effekt/
git commit -m "update compiler"
- name: Push changes
# here we have to make sure that trigger event is on 'manual'
# since 'on push' could cause a infinite loop of actions triggering each other
if: github.event_name == 'workflow_dispatch'
run: git push origin master