diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8624c48..8821e90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,3 +23,5 @@ jobs: make self make self time make self + update_bootstrap: + uses: ./.github/workflows/update_bootstrap.yml diff --git a/.github/workflows/update_bootstrap.yml b/.github/workflows/update_bootstrap.yml new file mode 100644 index 0000000..f500b08 --- /dev/null +++ b/.github/workflows/update_bootstrap.yml @@ -0,0 +1,35 @@ +name: Update Bootstrap Files + +on: + workflow_call: + +jobs: + update-files: + strategy: + matrix: + os: ["ubuntu-latest"] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Regenerate bootstrap files + run: make update_bootstrap + + - name: Commit and push changes + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "Pushing changes." + git add . + git commit -m "Auto-update bootstrap files" + git push + else + echo "No changes detected." + exit 0 + fi diff --git a/Makefile b/Makefile index 2b2444c..c2260eb 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ self: ld -o ibuc src/tokenizer.o src/parser.o src/codegen.o src/preprocessor.o src/ibu.o lib/std.o lib/runtime.o lib/linux-syscall.o .PHONY: update_bootstrap -update_bootstrap: +update_bootstrap: init ./ibuc src/ibu.ibu > bootstrap/ibu.s ./ibuc src/tokenizer/tokenizer.ibu > bootstrap/tokenizer.s ./ibuc src/parser/parser.ibu > bootstrap/parser.s