Skip to content

Commit

Permalink
wf(vpnx): fix aur publish (#492)
Browse files Browse the repository at this point in the history
* fix wf

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fockit

* wip

* wip
  • Loading branch information
doums authored Jun 14, 2024
1 parent d485598 commit 2beafcc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/aur-nym-vpn-x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,48 @@ on:
pkgrel:
description: "PKGBUILD package release number"
required: false
type: number
default: 1
publish_aur:
description: "publish PKGBUILD changes to AUR"
type: boolean
required: false
default: true

jobs:
aur-publish:
name: Publish package in AUR
runs-on: ubuntu-latest
defaults:
run:
working-directory: nym-vpn-x
env:
PKGNAME: nymvpn-x
PKGBUILD: .pkg/aur/PKGBUILD
PKGBUILD: nym-vpn-x/.pkg/aur/PKGBUILD
PKGREL: ${{ inputs.pkgrel }}
RELEASE_TAG: ${{ inputs.release_tag }}
REPOSITORY: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download sources
run: curl -LfsSo "$RELEASE_TAG.tar.gz" "https://github.com/$REPOSITORY/archive/refs/tags/$RELEASE_TAG.tar.gz"
run: |
curl -LfsSo "$RELEASE_TAG.tar.gz" "https://github.com/$REPOSITORY/archive/refs/tags/$RELEASE_TAG.tar.gz"
mkdir tarball
tar -xzf "$RELEASE_TAG.tar.gz" -C tarball
- name: Get app version
id: app-version
uses: nicolaiunrein/cargo-get@master
with:
subcommand: package.version --entry src-tauri
subcommand: package.version --entry="tarball/nym-vpn-client-${{ env.RELEASE_TAG }}/nym-vpn-x/src-tauri"
- name: Update PKGBUILD
working-directory: nym-vpn-x/.pkg/aur
env:
PKGBUILD: PKGBUILD
TARBALL: ${{ github.workspace }}/${{ env.RELEASE_TAG }}.tar.gz
PKGVER: ${{ steps.app-version.outputs.metadata }}
run: .pkg/aur/update.sh
run: ./update.sh
- name: Show PKGBUILD
run: cat "$PKGBUILD"
- name: Publish
if: publish_aur == true
if: inputs.publish_aur == true
uses: KSXGitHub/[email protected]
with:
pkgname: ${{ env.PKGNAME }}
Expand All @@ -57,7 +62,6 @@ jobs:
ssh_private_key: ${{ secrets.AUR_SSH_KEY }}
commit_message: ${{ inputs.release_tag }}
assets: |
.pkg/aur/nymvpn-x-wrapper.sh
.pkg/aur/nymvpn-x.desktop
.pkg/aur/nymvpn-x.svg
nym-vpn-x/.pkg/aur/nymvpn-x-wrapper.sh
nym-vpn-x/.pkg/aur/nymvpn-x.desktop
nym-vpn-x/.pkg/aur/nymvpn-x.svg
4 changes: 2 additions & 2 deletions nym-vpn-x/.pkg/aur/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ arch=('x86_64')
url='https://github.com/nymtech/nym-vpn-client'
license=('GPL-3.0-only')
depends=('glibc' 'gcc-libs' 'bash' 'cairo' 'pango' 'gtk3' 'webkit2gtk' 'gdk-pixbuf2' 'glib2' 'openssl' 'libsoup')
makedepends=('rust' 'cargo' 'npm')
makedepends=('rust' 'cargo' 'protobuf' 'npm')
optdepends=('nym-vpnd: NymVPN daemon as a systemd service')
provides=('nymvpn-x')
conflicts=('nymvpn-x')
Expand Down Expand Up @@ -40,7 +40,7 @@ build() {
# sqlx does not support LTO build flag, which is enabled by default in Arch
# set the C flag -ffat-lto-objects to solve the issue
# see https://github.com/launchbadge/sqlx/issues/3149
CFLAGS+=" -ffat-lto-objects" npm run tauri build -- -b none
CFLAGS+=" -ffat-lto-objects" npm run tauri build -- --bundles none
}

package() {
Expand Down
8 changes: 3 additions & 5 deletions nym-vpn-x/.pkg/aur/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ if ! [ -a "$PKGBUILD" ]; then
exit 1
fi

tarball="$RELEASE_TAG.tar.gz"

if ! [ -a "$tarball" ]; then
>&2 echo " ✕ no such file $tarball"
if ! [ -a "$TARBALL" ]; then
>&2 echo " ✕ no such file $TARBALL"
exit 1
fi

Expand All @@ -59,7 +57,7 @@ fi

# ⚠ order is important and should match the order of sources array
# declared in the PKGBUILD
sources=("$tarball" '.pkg/aur/nymvpn-x-wrapper.sh' '.pkg/aur/nymvpn-x.desktop' '.pkg/aur/nymvpn-x.svg')
sources=("$TARBALL" 'nymvpn-x-wrapper.sh' 'nymvpn-x.desktop' 'nymvpn-x.svg')
sums=()

for file in "${sources[@]}"; do
Expand Down

0 comments on commit 2beafcc

Please sign in to comment.