update effekt compiler #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- name: Update submodule | |
run: | | |
cd effekt/ | |
git checkout master | |
git pull | |
if [ -n "$effekt_commit" ]; then | |
git checkout ${{ github.event.inputs.effekt_commit }} | |
fi | |
- name: Build Effekt JS | |
run: | | |
sbt assembleJS | |
- name: Copy js file to website | |
run: | | |
cp -f out/effekt.js ../src/effekt.js | |
cd .. | |
- 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 |