From e67fb5feccb3ab694de8f0fae3d85964eeb3a555 Mon Sep 17 00:00:00 2001 From: madonuko Date: Sat, 20 Jul 2024 18:23:41 +0800 Subject: [PATCH 1/2] feat(ci): use v4 --- .github/workflows/autobuild.yml | 13 +++---------- .github/workflows/mass-rebuild.yml | 4 ++-- .github/workflows/update-comps.yml | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index a431adb..e35ddd0 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -25,7 +25,7 @@ jobs: - name: Set workspace as safe run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Generate build matrix @@ -44,19 +44,12 @@ jobs: options: --cap-add=SYS_ADMIN --privileged steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up git repository run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Cache buildroot - id: br-cache - uses: actions/cache@v3 - with: - path: /var/cache - key: ${{ runner.os }}-br-${{ matrix.version }}-${{ matrix.pkg.arch }} - - name: Include custom build template instead of package default run: | cp -v ultramarine/ultramarine-mock-configs/ultramarine.tpl /etc/mock/templates/ultramarine.tpl @@ -71,7 +64,7 @@ jobs: x=${NAME//\//@} echo "name=$x" >> $GITHUB_OUTPUT - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ steps.art.outputs.name }} path: | diff --git a/.github/workflows/mass-rebuild.yml b/.github/workflows/mass-rebuild.yml index 4c2648a..fde06ca 100644 --- a/.github/workflows/mass-rebuild.yml +++ b/.github/workflows/mass-rebuild.yml @@ -50,7 +50,7 @@ jobs: options: --cap-add=SYS_ADMIN --privileged steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up git repository @@ -70,7 +70,7 @@ jobs: x=${NAME//\//@} echo "name=$x" >> $GITHUB_OUTPUT - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ steps.art.outputs.name }} path: | diff --git a/.github/workflows/update-comps.yml b/.github/workflows/update-comps.yml index 93448d6..6ccb9ee 100644 --- a/.github/workflows/update-comps.yml +++ b/.github/workflows/update-comps.yml @@ -14,7 +14,7 @@ jobs: container: image: ghcr.io/terrapkg/builder:f40 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Push to subatomic run: | branch=${{ github.ref_name }} From 0aa492add2602955a0340382e5f53c5de877a5f2 Mon Sep 17 00:00:00 2001 From: madonuko Date: Sat, 20 Jul 2024 21:00:35 +0800 Subject: [PATCH 2/2] feat(ci): update CI --- .github/workflows/update.yml | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..004d58e --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,53 @@ +name: Update +on: + schedule: + - cron: "0 * * * *" + workflow_dispatch: + +jobs: + autoupdate: + runs-on: ubuntu-latest + container: + image: ghcr.io/terrapkg/builder:frawhide + options: --cap-add=SYS_ADMIN --privileged + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ssh-key: ${{ secrets.SSH_AUTHENTICATION_KEY }} + + - name: Install SSH signing key & Set up git repository + run: | + mkdir -p ${{ runner.temp }} + echo "${{ secrets.SSH_SIGNING_KEY }}" > ${{ runner.temp }}/signing_key + chmod 0700 ${{ runner.temp }}/signing_key + git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Run Update + run: anda update -vv + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RUST_BACKTRACE: full + + - name: Save + run: | + if [[ `git status --porcelain` ]]; then + git config user.name "Raboneko" + git config user.email "raboneko@fyralabs.com" + git config gpg.format "ssh" + git config user.signingkey "${{ runner.temp }}/signing_key" + msg="bump: $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')" + git commit -S -a -m "$msg" + copy_over () { + git format-patch HEAD^ + git checkout $1 + git apply *.patch || true + rm *.patch + git add * + git commit -S -a -m "$msg" + } + copy_over f39 || true + copy_over f40 || true + git push -u origin --all + fi