From 6eebabffa69e70150ca90a1f9a1d2161a9d93c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Fearn?= <26871415+flavioislima@users.noreply.github.com> Date: Tue, 31 Oct 2023 20:25:09 +0100 Subject: [PATCH] [CI] Automate AUR Publishing (#3107) * [CI] Automate AUR Publishing * fix: remove unecessary steps * Revert "fix: remove unecessary steps" This reverts commit 516b7b414e69f4b92e726cd7d53ed60f146c2358. * fix: remove unecesary dependency * Update release_aur.yml * fix: pr comments * chore: use curl instead of wget --------- Co-authored-by: Flavio F Lima --- .github/workflows/release_aur.yml | 79 +++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/release_aur.yml diff --git a/.github/workflows/release_aur.yml b/.github/workflows/release_aur.yml new file mode 100644 index 0000000000..a237b806bb --- /dev/null +++ b/.github/workflows/release_aur.yml @@ -0,0 +1,79 @@ +name: Update AUR + +on: + release: + types: [published] + +jobs: + update-aur: + runs-on: ubuntu-latest + + container: + image: archlinux + + steps: + - name: Install Dependencies + run: | + pacman -Syu --noconfirm jq + + - name: Download Package + run: | + set -x + latest_version=$(curl -s https://api.github.com/repos/Heroic-Games-Launcher/HeroicGamesLauncher/releases/latest | jq -r .tag_name) + version_without_v=$(echo $latest_version | cut -c 2-) + curl -L https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases/download/${latest_version}/heroic-${version_without_v}.pacman -o heroic.pacman + set +x + if: ${{ success() }} + + - name: Update PKGBUILD + run: | + set -x + latest_version=$(curl -s https://api.github.com/repos/Heroic-Games-Launcher/HeroicGamesLauncher/releases/latest | jq -r .tag_name) + pkgver=${latest_version#v} + pkgrel=1 + url="https://heroicgameslauncher.com" + _filename=heroic-${pkgver}.pacman + source=("$url/releases/download/$latest_version/$_filename") + sha256sums=($(sha256sum heroic.pacman | cut -d' ' -f1)) + + cat < PKGBUILD + # Maintainer: flaviofearn + + pkgname=heroic-games-launcher-bin + pkgver=$pkgver + pkgrel=$pkgrel + pkgdesc="An Open source Launcher for Epic, Amazon and GOG Games" + arch=('x86_64') + url="$url" + license=('GPL3') + _filename=$_filename + source=("$source") + noextract=("$_filename") + sha256sums=(${sha256sums[@]}) + options=(!strip) + provides=(heroic-games-launcher) + conflicts=(heroic-games-launcher) + + package() { + tar -xJv -C "\$pkgdir" -f "\$srcdir/\$_filename" usr opt + mkdir "\$pkgdir/usr/bin" + ln -s "/opt/Heroic/heroic" "\$pkgdir/usr/bin/heroic" + } + + # vim:set ts=2 sw=2 et: syntax=sh + + EOF + cat PKGBUILD + set +x + if: ${{ success() }} + + - name: Publish AUR package + uses: KSXGitHub/github-actions-deploy-aur@v2 + with: + pkgname: heroic-games-launcher-bin + pkgbuild: ./PKGBUILD + commit_username: ${{ secrets.AUR_USERNAME }} + commit_email: ${{ secrets.AUR_EMAIL }} + ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE }} + commit_message: Update AUR package + ssh_keyscan_types: rsa,dsa,ecdsa,ed25519