Skip to content

Commit 45a9c2f

Browse files
authored
[CI] Automate Snaps and AUR releases (#526)
* 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 <flavioislima@users.noreply.github.com>
1 parent b01c919 commit 45a9c2f

File tree

2 files changed

+81
-2
lines changed

2 files changed

+81
-2
lines changed

.github/workflows/release_aur.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Update AUR
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
update-aur:
9+
runs-on: ubuntu-latest
10+
11+
container:
12+
image: archlinux
13+
14+
steps:
15+
- name: Install Dependencies
16+
run: |
17+
pacman -Syu --noconfirm wget jq
18+
19+
- name: Download Package
20+
run: |
21+
set -x
22+
latest_version=$(curl -s https://api.github.com/repos/HyperPlay-Gaming/hyperplay-desktop-client/releases/latest | jq -r .tag_name)
23+
version_without_v=$(echo $latest_version | cut -c 2-)
24+
wget https://github.com/HyperPlay-Gaming/hyperplay-desktop-client/releases/download/${latest_version}/hyperplay-${version_without_v}.pacman -O hyperplay.pacman
25+
set +x
26+
if: ${{ success() }}
27+
28+
- name: Update PKGBUILD
29+
run: |
30+
set -x
31+
latest_version=$(curl -s https://api.github.com/repos/HyperPlay-Gaming/hyperplay-desktop-client/releases/latest | jq -r .tag_name)
32+
pkgver=${latest_version#v}
33+
pkgrel=1
34+
url="https://github.com/HyperPlay-Gaming/hyperplay-desktop-client"
35+
_filename=hyperplay-${pkgver}.pacman
36+
source=("$url/releases/download/$latest_version/$_filename")
37+
md5sums=($(md5sum hyperplay.pacman | cut -d' ' -f1))
38+
39+
cat <<EOF > PKGBUILD
40+
# Maintainer: flaviofearn <flavioislima@gmail.com>
41+
# Maintainer: blingus <brett@hyperplay.xyz>
42+
43+
pkgname=hyperplay
44+
pkgver=$pkgver
45+
pkgrel=$pkgrel
46+
pkgdesc="An open source Web3 gaming platform."
47+
arch=('x86_64')
48+
url="$url"
49+
license=('GPL3')
50+
depends=('gawk')
51+
_filename=$_filename
52+
source=("$source")
53+
noextract=("$_filename")
54+
md5sums=(${md5sums[@]})
55+
options=(!strip)
56+
57+
package() {
58+
tar -xJv -C "\$pkgdir" -f "\$srcdir/\$_filename" usr opt
59+
mkdir "\$pkgdir/usr/bin"
60+
ln -s "/opt/HyperPlay/hyperplay" "\$pkgdir/usr/bin/hyperplay"
61+
}
62+
63+
# vim:set ts=2 sw=2 et: syntax=sh
64+
65+
EOF
66+
cat PKGBUILD
67+
set +x
68+
if: ${{ success() }}
69+
70+
- name: Publish AUR package
71+
uses: KSXGitHub/github-actions-deploy-aur@v2
72+
with:
73+
pkgname: hyperplay
74+
pkgbuild: ./PKGBUILD
75+
commit_username: ${{ secrets.AUR_USERNAME }}
76+
commit_email: ${{ secrets.AUR_EMAIL }}
77+
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE }}
78+
commit_message: Update AUR package
79+
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"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.",
138138
"publish": {
139139
"provider": "snapStore",
140-
"channels": "beta",
140+
"channels": "stable",
141141
"repo": "hyperplay"
142142
}
143143
}
@@ -239,7 +239,7 @@
239239
"test:e2e": "cross-env-shell docker compose -f e2e/docker-compose.yml run --rm --build process_all bash e2e/entrypoint.sh",
240240
"test:e2ePackaged": "cross-env TEST_PACKAGED=true yarn test:e2e",
241241
"manualTestProxyJest": "jest mmExtIntegration.test.ts",
242-
"release:linux": "export NODE_ENV_ELECTRON_VITE=production && vite build && electron-builder -p always --linux deb rpm pacman tar.xz",
242+
"release:linux": "export NODE_ENV_ELECTRON_VITE=production && vite build && electron-builder -p always --linux deb rpm pacman tar.xz snap",
243243
"release:updateFlathub:ci": "tsc flathub/update-flathub.ts --skipLibCheck --target es2015 --moduleResolution node --module commonjs && node flathub/update-flathub.js",
244244
"release:mac": "export NODE_ENV_ELECTRON_VITE=production && vite build && electron-builder -p always --mac --x64 --arm64",
245245
"dist:linux": "export NODE_ENV_ELECTRON_VITE=production && vite build && electron-builder --linux",

0 commit comments

Comments
 (0)