Files
packages/.github/workflows/update.yml
T
2024-02-05 00:20:26 -08:00

66 lines
2.5 KiB
YAML

name: Update
on:
schedule:
- cron: "*/10 * * * *"
workflow_dispatch:
jobs:
autoupdate:
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/builder:f39
options: --cap-add=SYS_ADMIN --privileged
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_AUTHENTICATION_KEY }}
- name: Install SSH signing key
run: |
mkdir -p ${{ runner.temp }}
echo "${{ secrets.SSH_SIGNING_KEY }}" > ${{ runner.temp }}/signing_key
chmod 0700 ${{ runner.temp }}/signing_key
- name: Run Update
run: anda update -vv
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"
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 f37 || true
copy_over f38 || true
copy_over frawhide || true
git remote add raboneko git@github.com:raboneko/packages.git
git push -u origin --all
gh pr create --title "$msg" --body "Automatic update from Raboneko!" --label "auto-update" --base "f37" --head "raboneko:f37"
gh pr create --title "$msg" --body "Automatic update from Raboneko!" --label "auto-update" --base "f38" --head "raboneko:f38"
gh pr create --title "$msg" --body "Automatic update from Raboneko!" --label "auto-update" --base "frawhide" --head "raboneko:frawhide"
gh pr create --title "$msg" --body "Automatic update from Raboneko!" --label "auto-update" --base "f39" --head "raboneko:f39"
gh pr merge --auto --squash raboneko:f37
gh pr merge --auto --squash raboneko:f38
gh pr merge --auto --squash raboneko:frawhide
gh pr merge --auto --squash raboneko:f39
fi