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