Skip to content

Commit

Permalink
[CI] Automate Snaps and AUR releases (#526)
Browse files Browse the repository at this point in the history
* feat: automate snaps

* feat: adds AUR release script

* fix: check pkgrel as well

* chore: test aur automation

* fix: archlinux image

* fix: install openssh

* fix: download url

* fix: remove v from download package

* fix_ install git

* fix: working dir

* chore: try makepkg as nobody

* chore: try to manually update SRCINFO

* fix: aur repo

* fixing hosts second time

* trying to clone aur repo again

* aur craziness

* another try

* try using gh action

* chore: run only on releases

* chore: remove unecessary dependency

---------

Co-authored-by: Flavio F Lima <[email protected]>
  • Loading branch information
flavioislima and flavioislima authored Oct 4, 2023
1 parent b01c919 commit 45a9c2f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 2 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/release_aur.yml
Original file line number Diff line number Diff line change
@@ -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 wget jq
- name: Download Package
run: |
set -x
latest_version=$(curl -s https://api.github.com/repos/HyperPlay-Gaming/hyperplay-desktop-client/releases/latest | jq -r .tag_name)
version_without_v=$(echo $latest_version | cut -c 2-)
wget https://github.com/HyperPlay-Gaming/hyperplay-desktop-client/releases/download/${latest_version}/hyperplay-${version_without_v}.pacman -O hyperplay.pacman
set +x
if: ${{ success() }}

- name: Update PKGBUILD
run: |
set -x
latest_version=$(curl -s https://api.github.com/repos/HyperPlay-Gaming/hyperplay-desktop-client/releases/latest | jq -r .tag_name)
pkgver=${latest_version#v}
pkgrel=1
url="https://github.com/HyperPlay-Gaming/hyperplay-desktop-client"
_filename=hyperplay-${pkgver}.pacman
source=("$url/releases/download/$latest_version/$_filename")
md5sums=($(md5sum hyperplay.pacman | cut -d' ' -f1))
cat <<EOF > PKGBUILD
# Maintainer: flaviofearn <[email protected]>
# Maintainer: blingus <[email protected]>
pkgname=hyperplay
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/HyperPlay/hyperplay" "\$pkgdir/usr/bin/hyperplay"
}
# 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: hyperplay
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"description": "HyperPlay allows players to carry their MetaMask or WalletConnect wallet overlaid on top of every desktop game. Game developers can request transactions or signatures with a simple REST API call that supports every wallet to manage wallet interactions seamlessly. \n You can also access your Epic and GOG games and play them using Proton or Wine that can be downloaded directly from the interface. DXVK, VKD3D and Winetricks are also included to play Windows Games.",
"publish": {
"provider": "snapStore",
"channels": "beta",
"channels": "stable",
"repo": "hyperplay"
}
}
Expand Down Expand Up @@ -239,7 +239,7 @@
"test:e2e": "cross-env-shell docker compose -f e2e/docker-compose.yml run --rm --build process_all bash e2e/entrypoint.sh",
"test:e2ePackaged": "cross-env TEST_PACKAGED=true yarn test:e2e",
"manualTestProxyJest": "jest mmExtIntegration.test.ts",
"release:linux": "export NODE_ENV_ELECTRON_VITE=production && vite build && electron-builder -p always --linux deb rpm pacman tar.xz",
"release:linux": "export NODE_ENV_ELECTRON_VITE=production && vite build && electron-builder -p always --linux deb rpm pacman tar.xz snap",
"release:updateFlathub:ci": "tsc flathub/update-flathub.ts --skipLibCheck --target es2015 --moduleResolution node --module commonjs && node flathub/update-flathub.js",
"release:mac": "export NODE_ENV_ELECTRON_VITE=production && vite build && electron-builder -p always --mac --x64 --arm64",
"dist:linux": "export NODE_ENV_ELECTRON_VITE=production && vite build && electron-builder --linux",
Expand Down

0 comments on commit 45a9c2f

Please sign in to comment.