From 5d7b33279b3df42f1217f264ef6a3b414273b776 Mon Sep 17 00:00:00 2001 From: madonuko Date: Sun, 15 Dec 2024 01:13:30 +0800 Subject: [PATCH] feat(ci): fix bugs with update backporting, add weekly mode, remove f39, add el10 (#2610) --- .github/workflows/autobuild.yml | 3 +- .github/workflows/bootstrap.yml | 1 - .github/workflows/update-branch.yml | 54 ++++++++++++++++++++++++++++ .github/workflows/update-comps.yml | 6 ++-- .github/workflows/update-nightly.yml | 20 +++++------ .github/workflows/update-weekly.yml | 53 +++++++++++++++++++++++++++ .github/workflows/update.yml | 20 +++++------ 7 files changed, 131 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/update-branch.yml create mode 100644 .github/workflows/update-weekly.yml diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 86af62f3ec..18eb3b6d00 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -44,7 +44,7 @@ jobs: fail-fast: false runs-on: ${{ matrix.pkg.arch == 'aarch64' && 'ARM64' || matrix.pkg.labels['large'] && 'x86-64-lg' || 'ubuntu-latest' }} container: - image: ghcr.io/terrapkg/builder:f${{ matrix.version}} + image: ghcr.io/terrapkg/builder:f${{ matrix.version }} options: --cap-add=SYS_ADMIN --privileged steps: - name: Checkout @@ -55,6 +55,7 @@ jobs: - name: Checkout latest Mock configs uses: actions/checkout@v4 with: + fetch-depth: 0 repository: terrapkg/mock-configs path: mock-configs diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index ab68a6cc77..cb80bdfa47 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -53,7 +53,6 @@ jobs: terra${{ matrix.version }} anda-build/rpm/rpms/* - name: Upload source packages to subatomic - if: github.event_name == 'push' run: | subatomic-cli upload --prune \ --server https://subatomic.fyralabs.com \ diff --git a/.github/workflows/update-branch.yml b/.github/workflows/update-branch.yml new file mode 100644 index 0000000000..13153d3439 --- /dev/null +++ b/.github/workflows/update-branch.yml @@ -0,0 +1,54 @@ +name: Update per branch +on: + schedule: + - cron: "*/30 * * * *" + workflow_dispatch: + +jobs: + autoupdate: + runs-on: ubuntu-latest + strategy: + matrix: + branch: + - frawhide + - f40 + - f41 + - el10 + container: + image: ghcr.io/terrapkg/builder:frawhide + options: --cap-add=SYS_ADMIN --privileged + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + 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: | + nbranch="${{ matrix.branch }}" + [ "$nbranch" = 'frawhide' ] && nbranch='f42' + anda update -vv --filters updbranch=1 --labels branch=${{ matrix.branch }},nbranch=$nbranch + 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-comps.yml b/.github/workflows/update-comps.yml index 38612930be..57d5b7a25e 100644 --- a/.github/workflows/update-comps.yml +++ b/.github/workflows/update-comps.yml @@ -3,10 +3,10 @@ name: Push comps updates on: push: branches: + - frawhide + - f41 - f40 - - f39 - - f38 - - f37 + - el10 paths: - comps.xml workflow_dispatch: diff --git a/.github/workflows/update-nightly.yml b/.github/workflows/update-nightly.yml index 615f0f35d9..104af60f41 100644 --- a/.github/workflows/update-nightly.yml +++ b/.github/workflows/update-nightly.yml @@ -8,7 +8,7 @@ jobs: autoupdate: runs-on: ubuntu-latest container: - image: ghcr.io/terrapkg/builder:f40 + image: ghcr.io/terrapkg/builder:frawhide options: --cap-add=SYS_ADMIN --privileged steps: - name: Checkout @@ -17,20 +17,21 @@ jobs: fetch-depth: 0 ssh-key: ${{ secrets.SSH_AUTHENTICATION_KEY }} - - name: Install SSH signing 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 Nightly Update - run: anda update -vv --filters nightly=1 + run: anda update -v --filters nightly=1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RUST_BACKTRACE: full - name: Save run: | - git config --global --add safe.directory "*" if [[ `git status --porcelain` ]]; then git config user.name "Raboneko" git config user.email "raboneko@fyralabs.com" @@ -38,16 +39,15 @@ jobs: git config user.signingkey "${{ runner.temp }}/signing_key" msg="bump(nightly): $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')" git commit -S -a -m "$msg" + git format-patch HEAD^ copy_over () { - git format-patch HEAD^ git checkout $1 git apply *.patch || true - rm *.patch - git add * + git add anda git commit -S -a -m "$msg" } - copy_over f37 || true - copy_over f38 || true - copy_over frawhide || true + copy_over f40 || true + copy_over f41 || true + copy_over el10 || true git push -u origin --all fi diff --git a/.github/workflows/update-weekly.yml b/.github/workflows/update-weekly.yml new file mode 100644 index 0000000000..46e41cb713 --- /dev/null +++ b/.github/workflows/update-weekly.yml @@ -0,0 +1,53 @@ +name: Weekly Update +on: + schedule: + - cron: "0 0 * * 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 Weekly Update + run: anda update -v --filters weekly=1 + 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(weekly): $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')" + git commit -S -a -m "$msg" + git format-patch HEAD^ + copy_over () { + git checkout $1 + git apply *.patch || true + git add anda + git commit -S -a -m "$msg" + } + copy_over f40 || true + copy_over f41 || true + copy_over el10 || true + git push -u origin --all + fi diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 0381bd64d5..d87a3fbc57 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -8,7 +8,7 @@ jobs: autoupdate: runs-on: ubuntu-latest container: - image: ghcr.io/terrapkg/builder:f40 + image: ghcr.io/terrapkg/builder:frawhide options: --cap-add=SYS_ADMIN --privileged steps: - name: Checkout @@ -17,21 +17,21 @@ jobs: fetch-depth: 0 ssh-key: ${{ secrets.SSH_AUTHENTICATION_KEY }} - - name: Install SSH signing 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 + run: anda update -v --excludes nightly=1 --excludes weekly=1 --excludes updbranch=1 env: GITHUB_TOKEN: ${{ secrets.AUTOUPDATE_GH_TOKEN }} RUST_BACKTRACE: full - name: Save run: | - git config --global --add safe.directory "*" if [[ `git status --porcelain` ]]; then git config user.name "Raboneko" git config user.email "raboneko@fyralabs.com" @@ -39,17 +39,15 @@ jobs: 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" + git format-patch HEAD^ copy_over () { - git format-patch HEAD^ git checkout $1 git apply *.patch || true - rm *.patch - git add * + git add anda git commit -S -a -m "$msg" } - copy_over f39 || true - copy_over f37 || true - copy_over f38 || true - copy_over frawhide || true + copy_over f40 || true + copy_over f41 || true + copy_over el10 || true git push -u origin --all fi