From 8b9abaa2101bfa9ec76b11304e29fc92a4042b37 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sat, 10 Aug 2024 03:43:45 +0200 Subject: [PATCH] Add pack workflow --- .github/workflows/pack.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/pack.yml diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml new file mode 100644 index 0000000..75ef787 --- /dev/null +++ b/.github/workflows/pack.yml @@ -0,0 +1,37 @@ +name: Pack cc-runtime + +on: [push] + +jobs: + pack: + name: Pack cc-runtime + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: '0' + + - name: Pack cc-runtime + run: | + set -e + cat assembly.h int_endianness.h int_types.h int_lib.h int_util.h $(find . -name *.c | LC_ALL=C sort) > /tmp/cc-runtime.c + grep '#include <' /tmp/cc-runtime.c > /tmp/saved-includes + sed -i '/#include/d' /tmp/cc-runtime.c + cat /tmp/saved-includes /tmp/cc-runtime.c > /tmp/cc-runtime.c.tmp + mv /tmp/cc-runtime.c.tmp /tmp/cc-runtime.c + + - name: Push packed cc-runtime + run: | + set -ex + git config user.name 'mintsuki' + git config user.email 'mintsuki@users.noreply.github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/osdev0/cc-runtime.git + git fetch --all + git checkout packed || git checkout --orphan packed + rm -rf .github *.c *.h *.inc + mv /tmp/cc-runtime.c ./ + git add -f . + git commit -m "Push packed cc-runtime.c" + git push origin packed