1
0
forked from blue/lmdbal
lmdbal/.gitea/workflows/release.yml

47 lines
1.7 KiB
YAML
Raw Normal View History

2023-10-14 18:09:50 +00:00
name: LMDBAL Release workflow
run-name: ${{ gitea.actor }} is running LMDBAL Release workflow on release ${{ gitea.event.release.tag_name }}
on:
release:
types: [published]
jobs:
Archlinux:
runs-on: archlinux
steps:
- name: Download the release tarball
run: curl -sL ${{ gitea.server_url }}/${{ gitea.repository }}/archive/${{ gitea.event.release.tag_name }}.tar.gz --output tarball.tar.gz
- name: Calculate SHA256 for the tarball
run: echo "tbSum=$(sha256sum tarball.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_ENV
- name: Unarchive tarball
run: tar -xvzf tarball.tar.gz
- name: Clone the AUR repository
run: |
echo "${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}" > key
chmod 600 key
GIT_SSH_COMMAND="ssh -i key -o 'IdentitiesOnly yes' -o 'StrictHostKeyChecking no'" git clone ssh://aur@aur.archlinux.org/lmdbal.git aur
chmod 777 -R aur
cd aur
git config user.name ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
git config user.email ${{ secrets.DEPLOY_TO_AUR_EMAIL }}
- name: Copy PKGBUILD to the directory
run: cp lmdbal/packaging/Archlinux/PKGBUILD aur/
- name: Put SHA256 sum to PKGBUILD file, and generate .SRCINFO
working-directory: aur
run: |
sed -i "/sha256sums=/c\sha256sums=('${{ env.tbSum }}')" PKGBUILD
sudo -u build makepkg --printsrcinfo > .SRCINFO
- name: Commit package to aur
working-directory: aur
run: |
git add PKGBUILD .SRCINFO
git commit -m "${{ gitea.event.release.body }}"
GIT_SSH_COMMAND="ssh -i ../key -o 'IdentitiesOnly yes' -o 'StrictHostKeyChecking no'" git push