Fix CI setup
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7f4cfcab74
commit
02e6239e1a
2 changed files with 56 additions and 1 deletions
53
.forgejo/workflows/ci.yml
Normal file
53
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
name: check-for-update
|
||||
|
||||
# Replaces the GitLab pipeline schedule (cron was 47 * * * * in Europe/Berlin, Forgejo cron runs in UTC).
|
||||
on:
|
||||
schedule:
|
||||
- cron: '47 * * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
check-for-update:
|
||||
runs-on: default
|
||||
container:
|
||||
image: archlinux:latest
|
||||
steps:
|
||||
- name: Install tools
|
||||
run: |
|
||||
pacman-key --init
|
||||
pacman -Syu --noconfirm
|
||||
pacman -Sy --noconfirm sudo binutils curl git openssh jq nodejs
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
with:
|
||||
ref: master
|
||||
- name: Git setup
|
||||
env:
|
||||
GIT_USER_MAIL: ${{ secrets.GIT_USER_MAIL }}
|
||||
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
git config --global user.email "${GIT_USER_MAIL}"
|
||||
git config --global user.name "${GIT_USER_NAME}"
|
||||
- name: AUR SSH key
|
||||
env:
|
||||
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${AUR_SSH_KEY}" > ~/.ssh/id_rsa_aur
|
||||
chmod 600 ~/.ssh/id_rsa_aur
|
||||
printf '\nHost *\n StrictHostKeyChecking no\n UserKnownHostsFile /dev/null\n' >> ~/.ssh/config
|
||||
- name: Check for update and push
|
||||
run: |
|
||||
latest_version=$(curl -s https://api.github.com/repos/aptakube/aptakube/releases | jq -r '.[0].tag_name')
|
||||
source PKGBUILD
|
||||
if [ "${pkgver}" == "${latest_version}" ]; then
|
||||
echo "Current Version (${pkgver}) is the latest one, nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
echo "New Version available: ${latest_version} (current: ${pkgver})"
|
||||
./update.sh "${latest_version}"
|
||||
git add .
|
||||
git commit -m "Update to ${latest_version}"
|
||||
git push origin HEAD:master
|
||||
git remote add aur ssh://aur@aur.archlinux.org/aptakube.git
|
||||
GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa_aur' git push --set-upstream aur HEAD:master
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -3,4 +3,6 @@
|
|||
!.gitignore
|
||||
!.SRCINFO
|
||||
!update.sh
|
||||
!.gitlab-ci.yml
|
||||
!.forgejo/
|
||||
!.forgejo/workflows/
|
||||
!.forgejo/workflows/ci.yml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue