Update .forgejo/workflows/packages.yaml
Signed-off-by: xengi <forgejo@xengi.de>
This commit is contained in:
parent
0a62954349
commit
1f610c6666
1 changed files with 76 additions and 0 deletions
|
|
@ -7,6 +7,82 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
# https://aur.archlinux.org/packages/virtualfish/
|
||||
projen:
|
||||
runs-on: debian-stable
|
||||
env:
|
||||
PACKAGE_NAME: virtualfish
|
||||
container:
|
||||
image: git.sb20.xengi.de/xengi/archlinux-aur:latest
|
||||
credentials:
|
||||
username: xengi
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: yay -Sy --needed --noconfirm --noprogressbar curl jq namcap openssh git
|
||||
- name: Get versions
|
||||
id: versions
|
||||
run: |
|
||||
echo upstream=$(curl -sL "https://api.github.com/repos/justinmayer/${PACKAGE}/releases/latest" | jq -r '.tag_name') >> "$FORGEJO_OUTPUT"
|
||||
echo aur=$(curl -sL 'https://aur.archlinux.org/rpc/?v=5&type=info&arg[]=${{ env.PACKAGE_NAME }}' | jq -r '.results[0].Version | split("-")[0]') >> "$FORGEJO_OUTPUT"
|
||||
- name: Setup SSH
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
- name: Clone AUR repository
|
||||
run: git clone ssh://aur@aur.archlinux.org/${{ env.PACKAGE_NAME }}.git
|
||||
- name: Update package
|
||||
run: |
|
||||
cd "$FORGEJO_WORKSPACE/$PACKAGE_NAME"
|
||||
sed -i "s/^pkgver=.*/pkgver=${{ steps.versions.outputs.upstream }}/" PKGBUILD
|
||||
if [ "${{ steps.versions.outputs.upstream }}" != "${{ steps.versions.outputs.aur }}" ]; then sed -i 's/^pkgrel=.*/pkgrel=1/' PKGBUILD; fi
|
||||
updpkgsums
|
||||
makepkg --printsrcinfo > .SRCINFO
|
||||
- name: Test package
|
||||
run: |
|
||||
cd "$FORGEJO_WORKSPACE/$PACKAGE_NAME"
|
||||
makepkg -csi --noconfirm --noprogressbar
|
||||
namcap -i PKGBUILD
|
||||
namcap -i ${{ env.PACKAGE_NAME }}-*.pkg.tar.zst
|
||||
mkdir -p ~/.virtualenvs
|
||||
fish -c 'vf install'
|
||||
fish -c 'vf --help'
|
||||
- name: Upload new package
|
||||
if: ${{ steps.versions.outputs.upstream != steps.versions.outputs.aur }}
|
||||
run: |
|
||||
cd "$FORGEJO_WORKSPACE/$PACKAGE_NAME"
|
||||
git config user.name "update-bot"
|
||||
git config user.email "email@ricardo.band"
|
||||
git commit -m "bumped to version ${{ steps.versions.outputs.upstream }}" .SRCINFO PKGBUILD
|
||||
git push
|
||||
curl -s \
|
||||
--form-string "token=${{ secrets.PUSHOVER_API_TOKEN }}" \
|
||||
--form-string "user=${{ secrets.PUSHOVER_USER_KEY }}" \
|
||||
--form-string "priority=-2" \
|
||||
--form-string "sound=hey_listen" \
|
||||
--form-string "timestamp=$(date +%s)" \
|
||||
--form-string "title=AUR package ${{ env.PACKAGE_NAME }}" \
|
||||
--form-string "message=${{ env.PACKAGE_NAME }} updated from ${{ steps.versions.outputs.aur }} from ${{ steps.versions.outputs.upstream }}" \
|
||||
--form-string "url_title=Forgejo Pipeline" \
|
||||
--form-string "url=${{ env.FORGEJO_SERVER_URL }}/${{ env.FORGEJO_REPOSITORY }}/actions?workflow=packages.yaml&actor=0&status=0" \
|
||||
https://api.pushover.net/1/messages.json
|
||||
- name: Send notification
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
curl -s \
|
||||
--form-string "token=${{ secrets.PUSHOVER_API_TOKEN }}" \
|
||||
--form-string "user=${{ secrets.PUSHOVER_USER_KEY }}" \
|
||||
--form-string "priority=0" \
|
||||
--form-string "sound=hey_listen" \
|
||||
--form-string "timestamp=$(date +%s)" \
|
||||
--form-string "title=AUR package ${{ env.PACKAGE_NAME }} failure" \
|
||||
--form-string "message=Updating ${{ env.PACKAGE_NAME }} from ${{ steps.versions.outputs.aur }} to ${{ steps.versions.outputs.upstream }} failed." \
|
||||
--form-string "url_title=Forgejo Pipeline" \
|
||||
--form-string "url=${{ env.FORGEJO_SERVER_URL }}/${{ env.FORGEJO_REPOSITORY }}/actions?workflow=packages.yaml&actor=0&status=0" \
|
||||
https://api.pushover.net/1/messages.json
|
||||
# https://aur.archlinux.org/packages/projen/
|
||||
projen:
|
||||
runs-on: debian-stable
|
||||
|
|
|
|||
Loading…
Reference in a new issue