Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): update workflows for autoupdate per branch #1848

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/update-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update per branch
on:
schedule:
- cron: "*/30 * * * *"
workflow_dispatch:

jobs:
autoupdate:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- frawhide
- 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:
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: 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 "[email protected]"
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
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading