Skip to content

Commit

Permalink
github workflow to auto update bootstrap files on push to main
Browse files Browse the repository at this point in the history
  • Loading branch information
aswin-aach committed Dec 25, 2024
1 parent c5aee9d commit d0736c5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ jobs:
make self
make self
time make self
update_bootstrap:
uses: ./.github/workflows/update_bootstrap.yml
35 changes: 35 additions & 0 deletions .github/workflows/update_bootstrap.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0736c5

Please sign in to comment.