Update .forgejo/workflows/packages.yaml
Signed-off-by: xengi <forgejo@xengi.de>
This commit is contained in:
parent
3dcc936992
commit
93567d8c5c
1 changed files with 42 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
# https://aur.archlinux.org/packages/projen/
|
||||
projen:
|
||||
runs-on: debian-stable
|
||||
|
||||
|
|
@ -16,8 +17,47 @@ jobs:
|
|||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
steps:
|
||||
- run: cat /etc/os-release
|
||||
- run: yay --version
|
||||
- name: Install dependencies
|
||||
run: yay -Syyu --noconfirm --noprogressbar curl jq namcap openssh git
|
||||
- name: Get versions
|
||||
id: versions
|
||||
run: |
|
||||
echo upstream=$(curl -sL https://registry.npmjs.org/projen | jq -r '."dist-tags".latest') >> "$FORGEJO_ENV"
|
||||
echo aur=$(curl -sL 'https://aur.archlinux.org/rpc/?v=5&type=info&arg[]=projen' | jq -r '.results[0].Version | split("-")[0]') >> "$FORGEJO_ENV"
|
||||
- name: Setup SSH
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
- name: Clone AUR repository
|
||||
run: git clone ssh://aur@aur.archlinux.org/${{ env.PACKAGE_NAME }}.git
|
||||
- name: Update package
|
||||
run: |
|
||||
cd ${{ env.FORGEJO_WORKSPACE }}/${{ env.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 ${{ env.FORGEJO_WORKSPACE }}/${{ env.PACKAGE_NAME }}
|
||||
makepkg -csi --noconfirm --noprogressbar
|
||||
namcap -i PKGBUILD
|
||||
namcap -i ${{ env.PACKAGE_NAME }}-*.pkg.tar.zst
|
||||
projen --help
|
||||
- name: Upload new package
|
||||
if: "${{ steps.versions.outputs.upstream }}" != "${{ steps.versions.outputs.aur }}"
|
||||
run: |
|
||||
cd ${{ env.FORGEJO_WORKSPACE }}/${{ env.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 "message=${{ env.PACKAGE_NAME }} updated: ${{ steps.versions.outputs.aur }} -> ${{ steps.versions.outputs.upstream }}" \
|
||||
https://api.pushover.net/1/messages.json
|
||||
- name: Send notification
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Reference in a new issue