1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-05-12 12:00:13 +00:00

Update ./internal/source automatically

This commit is contained in:
Matthew Kilgore 2022-04-27 18:55:16 -04:00
parent 5031de2cd6
commit 707480642b
3 changed files with 32 additions and 1 deletions

View file

@ -2,10 +2,14 @@
./qb64_bootstrap -x -w source/qb64.bas
SUCCESS=$?
rm qb64_bootstrap
rm internal/source/*
rm internal/temp/debug_* internal/temp/recompile_*
mv internal/temp/* internal/source/
rm internal/source/debug_* internal/source/recompile_*
find . -type f -iname "*.a" -exec rm {} \;
find . -type f -iname "*.o" -exec rm {} \;
exit $SUCCESS

13
.ci/push-internal-source.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add ./internal/source/
if ! git diff --cached --quiet; then
echo "Pushing updated ./internal/source"
git commit -m 'Automatic update of ./internal/source'
git push
else
echo "No changes to ./internal/source"
fi

View file

@ -31,6 +31,13 @@ jobs:
with:
fetch-depth: 0
# A deploy key is setup so that the potential push of ./internal/source can
# trigger a new build. Care is taken to make sure loops cannot happen.
- uses: webfactory/ssh-agent@v0.5.4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
ssh-private-key: ${{ secrets.ACTION_DEPLOY_KEY }}
- name: Install dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt update && sudo apt install build-essential x11-utils mesa-common-dev libglu1-mesa-dev libasound2-dev zlib1g-dev
@ -69,6 +76,13 @@ jobs:
shell: bash
run: tests/run_dist_tests.sh ./dist/qb64 ${{ matrix.prefix }}
# Only update ./internal/source if we're building on Linux, building on
# the main branch, and building a Pull request merge. Otherwise the repo
# is left alone.
- name: Update ./internal/source
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'Merge pull request') }}
run: .ci/push-internal-source.sh
- uses: actions/upload-artifact@v3
if: always()
with: