From 4538f7c104de274f4a1a861598c5884f00cea17e Mon Sep 17 00:00:00 2001 From: madonuko Date: Thu, 8 Aug 2024 03:01:57 +0800 Subject: [PATCH 1/3] feat(ci): update workflows for autoupdate per branch --- .github/workflows/update-branch.yml | 50 +++++++++++++++++++++++++++++ .github/workflows/update.yml | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/update-branch.yml diff --git a/.github/workflows/update-branch.yml b/.github/workflows/update-branch.yml new file mode 100644 index 0000000000..3e0afc6013 --- /dev/null +++ b/.github/workflows/update-branch.yml @@ -0,0 +1,50 @@ +name: Update per branch +on: + schedule: + - cron: "*/30 * * * *" + workflow_dispatch: + +jobs: + autoupdate: + runs-on: ubuntu-latest + strategy: + matrix: + branch: + - f39 + - f40 + - f41 + - el9 + 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 --filters updbranch=1 --labels branch=${{ matrix.branch }} + 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(branch): $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')" + git commit -S -a -m "$msg" + git push -u origin --all + fi diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 80b5437661..fb7265809c 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -25,7 +25,7 @@ jobs: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Run Update - run: anda update -vv --excludes nightly=1 + run: anda update -vv --excludes nightly=1 --excludes updbranch=1 env: GITHUB_TOKEN: ${{ secrets.AUTOUPDATE_GH_TOKEN }} RUST_BACKTRACE: full From a1af302bb31300e49bfa7a740a6f2ce633a878fb Mon Sep 17 00:00:00 2001 From: madomado Date: Thu, 8 Aug 2024 03:15:56 +0800 Subject: [PATCH 2/3] actually checkout to the right branch Signed-off-by: madomado --- .github/workflows/update-branch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-branch.yml b/.github/workflows/update-branch.yml index 3e0afc6013..1a1f8dcb47 100644 --- a/.github/workflows/update-branch.yml +++ b/.github/workflows/update-branch.yml @@ -21,6 +21,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: + ref: ${{ matrix.branch }} fetch-depth: 0 ssh-key: ${{ secrets.SSH_AUTHENTICATION_KEY }} From 0b330874cee48c6f4d57d95345b21f56aea582e3 Mon Sep 17 00:00:00 2001 From: madomado Date: Thu, 8 Aug 2024 03:17:01 +0800 Subject: [PATCH 3/3] remember frawhide? Signed-off-by: madomado --- .github/workflows/update-branch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-branch.yml b/.github/workflows/update-branch.yml index 1a1f8dcb47..b96cae3e5d 100644 --- a/.github/workflows/update-branch.yml +++ b/.github/workflows/update-branch.yml @@ -10,6 +10,7 @@ jobs: strategy: matrix: branch: + - frawhide - f39 - f40 - f41