Skip to content

Future-proofing stuff #5

Future-proofing stuff

Future-proofing stuff #5

name: "\"Compile\" Groovy Scripts"
on:
push:
branches:
- main
paths-ignore:
- "compiled/**"
jobs:
compile:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Run Groovy Compiler
run: |
# Find groovy files starts with _ on current directory
groovyFiles=$(find . -type f -name "_*.groovy")
# Compile each groovy file
for file in $groovyFiles; do
compiledFile="compiled/$(basename "$file" | sed 's/^_//')"
echo "Compiling $file to $compiledFile"
python3 compiler.py "$file" "$compiledFile"
done
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add compiled
git commit -m "Compile Groovy Scripts"
git push