Add cargo-release config and automated AUR update job
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,3 +80,43 @@ jobs:
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets?name=${FILE}" \
|
||||
--data-binary "@${FILE}" --fail-with-body
|
||||
done
|
||||
|
||||
update-aur:
|
||||
needs: build
|
||||
runs-on: aarch64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Compute checksums and update PKGBUILD
|
||||
run: |
|
||||
TAG=${{ gitea.ref_name }}
|
||||
BASE="${{ gitea.server_url }}/${{ gitea.repository }}/releases/download/${TAG}"
|
||||
|
||||
SUM_X86=$(curl -sL "${BASE}/gpupaper-${TAG}-x86_64.tar.gz" | sha256sum | cut -d' ' -f1)
|
||||
SUM_AARCH=$(curl -sL "${BASE}/gpupaper-${TAG}-aarch64.tar.gz" | sha256sum | cut -d' ' -f1)
|
||||
|
||||
sed -i "s/sha256sums_x86_64=('.*')/sha256sums_x86_64=('${SUM_X86}')/" aur/PKGBUILD
|
||||
sed -i "s/sha256sums_aarch64=('.*')/sha256sums_aarch64=('${SUM_AARCH}')/" aur/PKGBUILD
|
||||
|
||||
- name: Push to AUR
|
||||
env:
|
||||
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
|
||||
run: |
|
||||
install -dm700 ~/.ssh
|
||||
echo "$AUR_SSH_KEY" > ~/.ssh/aur
|
||||
chmod 600 ~/.ssh/aur
|
||||
echo "Host aur.archlinux.org" >> ~/.ssh/config
|
||||
echo " IdentityFile ~/.ssh/aur" >> ~/.ssh/config
|
||||
echo " User aur" >> ~/.ssh/config
|
||||
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts 2>/dev/null
|
||||
|
||||
git clone ssh://aur@aur.archlinux.org/gpupaper.git /tmp/aur-gpupaper
|
||||
cp aur/PKGBUILD /tmp/aur-gpupaper/
|
||||
cd /tmp/aur-gpupaper
|
||||
makepkg --printsrcinfo > .SRCINFO
|
||||
git config user.name "Bendik Aagaard Lynghaug"
|
||||
git config user.email "bendik.lynghaug@gmail.com"
|
||||
git add PKGBUILD .SRCINFO
|
||||
git commit -m "Update to ${{ gitea.ref_name }}"
|
||||
git push origin master
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
publish = false
|
||||
allow-branch = ["main"]
|
||||
|
||||
[[pre-release-replacements]]
|
||||
file = "aur/PKGBUILD"
|
||||
search = "pkgver=.*"
|
||||
replace = "pkgver={{version}}"
|
||||
|
||||
[[pre-release-replacements]]
|
||||
file = "aur/PKGBUILD"
|
||||
search = "pkgrel=.*"
|
||||
replace = "pkgrel=1"
|
||||
Reference in New Issue
Block a user