From 672619dc11ca8518776b1ebfd2453a20d4b3d321 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Tue, 3 Oct 2023 10:05:35 +0100 Subject: [PATCH 1/7] [CI] Automate AUR Publishing --- .github/workflows/release_aur.yml | 78 +++++++++++++++++++++++++++++++ 1 file changed, 78 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..493ecde8a6 --- /dev/null +++ b/.github/workflows/release_aur.yml @@ -0,0 +1,78 @@ +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 base-devel wget 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-) + wget 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://github.com/Heroic-Games-Launcher/HeroicGamesLauncher" + _filename=heroic-${pkgver}.pacman + source=("$url/releases/download/$latest_version/$_filename") + md5sums=($(md5sum heroic.pacman | cut -d' ' -f1)) + + cat < PKGBUILD + # Maintainer: flaviofearn + + pkgname=heroic-games-launcher-bin + pkgver=$pkgver + pkgrel=$pkgrel + pkgdesc="An open source Web3 gaming platform." + arch=('x86_64') + url="$url" + license=('GPL3') + depends=('gawk') + _filename=$_filename + source=("$source") + noextract=("$_filename") + md5sums=(${md5sums[@]}) + options=(!strip) + + 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 From 516b7b414e69f4b92e726cd7d53ed60f146c2358 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Tue, 3 Oct 2023 10:08:11 +0100 Subject: [PATCH 2/7] fix: remove unecessary steps --- .github/workflows/release_aur.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/release_aur.yml b/.github/workflows/release_aur.yml index 493ecde8a6..442d8fbb6b 100644 --- a/.github/workflows/release_aur.yml +++ b/.github/workflows/release_aur.yml @@ -8,14 +8,7 @@ jobs: update-aur: runs-on: ubuntu-latest - container: - image: archlinux - steps: - - name: Install Dependencies - run: | - pacman -Syu --noconfirm base-devel wget jq - - name: Download Package run: | set -x From 7e4724b5fa8775a627a628434dc65b9d395639dd Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Tue, 3 Oct 2023 10:08:59 +0100 Subject: [PATCH 3/7] Revert "fix: remove unecessary steps" This reverts commit 516b7b414e69f4b92e726cd7d53ed60f146c2358. --- .github/workflows/release_aur.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release_aur.yml b/.github/workflows/release_aur.yml index 442d8fbb6b..493ecde8a6 100644 --- a/.github/workflows/release_aur.yml +++ b/.github/workflows/release_aur.yml @@ -8,7 +8,14 @@ jobs: update-aur: runs-on: ubuntu-latest + container: + image: archlinux + steps: + - name: Install Dependencies + run: | + pacman -Syu --noconfirm base-devel wget jq + - name: Download Package run: | set -x From 5d0d7bb4ca7f02c9d0fea2207aa293b77e0f10f4 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Tue, 3 Oct 2023 10:09:51 +0100 Subject: [PATCH 4/7] fix: remove unecesary dependency --- .github/workflows/release_aur.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_aur.yml b/.github/workflows/release_aur.yml index 493ecde8a6..abd4eea37d 100644 --- a/.github/workflows/release_aur.yml +++ b/.github/workflows/release_aur.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Install Dependencies run: | - pacman -Syu --noconfirm base-devel wget jq + pacman -Syu --noconfirm wget jq - name: Download Package run: | From 976d4706be7753ff2b348b1219f4019776f89ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Fearn?= <26871415+flavioislima@users.noreply.github.com> Date: Fri, 6 Oct 2023 20:18:10 +0100 Subject: [PATCH 5/7] Update release_aur.yml --- .github/workflows/release_aur.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_aur.yml b/.github/workflows/release_aur.yml index abd4eea37d..edff043c10 100644 --- a/.github/workflows/release_aur.yml +++ b/.github/workflows/release_aur.yml @@ -42,7 +42,7 @@ jobs: pkgname=heroic-games-launcher-bin pkgver=$pkgver pkgrel=$pkgrel - pkgdesc="An open source Web3 gaming platform." + pkgdesc="An Open source Launcher for Epic, Amazon and GOG Games" arch=('x86_64') url="$url" license=('GPL3') From 9230699d2e46ca028a4b105b124d9ceeb4e5dc07 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Wed, 18 Oct 2023 12:58:42 +0100 Subject: [PATCH 6/7] fix: pr comments --- .github/workflows/release_aur.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_aur.yml b/.github/workflows/release_aur.yml index edff043c10..68485b2f0b 100644 --- a/.github/workflows/release_aur.yml +++ b/.github/workflows/release_aur.yml @@ -31,10 +31,10 @@ jobs: 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://github.com/Heroic-Games-Launcher/HeroicGamesLauncher" + url="https://heroicgameslauncher.com" _filename=heroic-${pkgver}.pacman source=("$url/releases/download/$latest_version/$_filename") - md5sums=($(md5sum heroic.pacman | cut -d' ' -f1)) + sha256sums=($(sha256sum heroic.pacman | cut -d' ' -f1)) cat < PKGBUILD # Maintainer: flaviofearn @@ -46,12 +46,13 @@ jobs: arch=('x86_64') url="$url" license=('GPL3') - depends=('gawk') _filename=$_filename source=("$source") noextract=("$_filename") - md5sums=(${md5sums[@]}) + sha256sums=(${sha256sums[@]}) options=(!strip) + provides=(heroic-games-launcher) + conflicts=(heroic-games-launcher) package() { tar -xJv -C "\$pkgdir" -f "\$srcdir/\$_filename" usr opt From 9294f1ec8e58dcdaba215b6a33acb48cdea9e5ef Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Wed, 18 Oct 2023 13:07:00 +0100 Subject: [PATCH 7/7] chore: use curl instead of wget --- .github/workflows/release_aur.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_aur.yml b/.github/workflows/release_aur.yml index 68485b2f0b..a237b806bb 100644 --- a/.github/workflows/release_aur.yml +++ b/.github/workflows/release_aur.yml @@ -14,14 +14,14 @@ jobs: steps: - name: Install Dependencies run: | - pacman -Syu --noconfirm wget jq + 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-) - wget https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases/download/${latest_version}/heroic-${version_without_v}.pacman -O heroic.pacman + 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() }}