mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-23 15:46:13 -05:00
ci: publish aur git package
This commit is contained in:
4 files changed
+254
No files matched your search
@@ -0,0 +1,141 @@
|
|||||||
|
name: Publish AUR git package
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
build-package:
|
||||||
|
type: boolean
|
||||||
|
description: "Build the package before publishing"
|
||||||
|
required: true
|
||||||
|
default: true
|
||||||
|
publish:
|
||||||
|
type: boolean
|
||||||
|
description: "Push PKGBUILD, .SRCINFO, and gp.install to AUR"
|
||||||
|
required: true
|
||||||
|
default: true
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- packaging/aur/globalprotect-openconnect-git/**
|
||||||
|
- .github/workflows/publish-aur-git.yaml
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
aur:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: archlinux:base-devel
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
AUR_PACKAGE_DIR: packaging/aur/globalprotect-openconnect-git
|
||||||
|
AUR_REPO: ssh://[email protected]/globalprotect-openconnect-git.git
|
||||||
|
steps:
|
||||||
|
- name: Install checkout tools
|
||||||
|
run: pacman -Syu --noconfirm --needed git openssh
|
||||||
|
|
||||||
|
- name: Checkout GlobalProtect-openconnect
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Install build tools
|
||||||
|
run: |
|
||||||
|
pacman -Syu --noconfirm --needed \
|
||||||
|
appmenu-gtk-module \
|
||||||
|
cargo \
|
||||||
|
curl \
|
||||||
|
desktop-file-utils \
|
||||||
|
file \
|
||||||
|
git \
|
||||||
|
jq \
|
||||||
|
libappindicator-gtk3 \
|
||||||
|
libsecret \
|
||||||
|
libxml2 \
|
||||||
|
namcap \
|
||||||
|
openconnect \
|
||||||
|
openssh \
|
||||||
|
openssl \
|
||||||
|
pkgconf \
|
||||||
|
librsvg \
|
||||||
|
shared-mime-info \
|
||||||
|
vpnc \
|
||||||
|
wget \
|
||||||
|
webkit2gtk-4.1
|
||||||
|
|
||||||
|
- name: Prepare build user
|
||||||
|
run: |
|
||||||
|
useradd -m builder
|
||||||
|
chown -R builder:builder "$GITHUB_WORKSPACE"
|
||||||
|
|
||||||
|
- name: Refresh VCS package version
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
run: |
|
||||||
|
cd "$AUR_PACKAGE_DIR"
|
||||||
|
runuser -u builder -- makepkg --nobuild --noconfirm --cleanbuild
|
||||||
|
|
||||||
|
- name: Regenerate .SRCINFO
|
||||||
|
run: |
|
||||||
|
cd "$AUR_PACKAGE_DIR"
|
||||||
|
runuser -u builder -- makepkg --printsrcinfo > .SRCINFO
|
||||||
|
|
||||||
|
- name: Check committed .SRCINFO
|
||||||
|
if: ${{ github.event_name == 'push' }}
|
||||||
|
run: |
|
||||||
|
cd "$AUR_PACKAGE_DIR"
|
||||||
|
git diff --exit-code -- .SRCINFO
|
||||||
|
|
||||||
|
- name: Run namcap
|
||||||
|
run: |
|
||||||
|
cd "$AUR_PACKAGE_DIR"
|
||||||
|
runuser -u builder -- namcap PKGBUILD .SRCINFO
|
||||||
|
|
||||||
|
- name: Build package
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' && inputs['build-package'] }}
|
||||||
|
run: |
|
||||||
|
cd "$AUR_PACKAGE_DIR"
|
||||||
|
runuser -u builder -- makepkg --noconfirm --clean --cleanbuild
|
||||||
|
|
||||||
|
- name: Configure SSH
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish }}
|
||||||
|
env:
|
||||||
|
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||||
|
run: |
|
||||||
|
if [[ -z "$AUR_SSH_PRIVATE_KEY" ]]; then
|
||||||
|
echo "AUR_SSH_PRIVATE_KEY is required to publish to AUR" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
install -d -m 700 ~/.ssh
|
||||||
|
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur
|
||||||
|
chmod 600 ~/.ssh/aur
|
||||||
|
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
|
||||||
|
printf '%s\n' \
|
||||||
|
"Host aur.archlinux.org" \
|
||||||
|
" IdentityFile ~/.ssh/aur" \
|
||||||
|
" User aur" \
|
||||||
|
" StrictHostKeyChecking yes" \
|
||||||
|
> ~/.ssh/config
|
||||||
|
|
||||||
|
- name: Publish to AUR
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish }}
|
||||||
|
run: |
|
||||||
|
workdir="$(mktemp -d)"
|
||||||
|
git clone "$AUR_REPO" "$workdir/aur"
|
||||||
|
|
||||||
|
cp "$AUR_PACKAGE_DIR"/PKGBUILD "$workdir/aur/PKGBUILD"
|
||||||
|
cp "$AUR_PACKAGE_DIR"/.SRCINFO "$workdir/aur/.SRCINFO"
|
||||||
|
cp "$AUR_PACKAGE_DIR"/gp.install "$workdir/aur/gp.install"
|
||||||
|
|
||||||
|
cd "$workdir/aur"
|
||||||
|
if git diff --quiet; then
|
||||||
|
echo "AUR package is already up to date"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add PKGBUILD .SRCINFO gp.install
|
||||||
|
git commit -m "Update globalprotect-openconnect-git"
|
||||||
|
git push origin master
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
pkgbase = globalprotect-openconnect-git
|
||||||
|
pkgdesc = A GUI client for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method.
|
||||||
|
pkgver = 2.5.1.r1.g24f9bbb
|
||||||
|
pkgrel = 2
|
||||||
|
url = https://github.com/yuezk/GlobalProtect-openconnect
|
||||||
|
install = gp.install
|
||||||
|
arch = x86_64
|
||||||
|
arch = aarch64
|
||||||
|
license = GPL3
|
||||||
|
makedepends = git
|
||||||
|
makedepends = pkg-config
|
||||||
|
makedepends = openconnect>=8.20
|
||||||
|
makedepends = webkit2gtk-4.1
|
||||||
|
makedepends = curl
|
||||||
|
makedepends = wget
|
||||||
|
makedepends = file
|
||||||
|
makedepends = openssl
|
||||||
|
makedepends = appmenu-gtk-module
|
||||||
|
makedepends = libappindicator-gtk3
|
||||||
|
makedepends = librsvg
|
||||||
|
makedepends = libsecret
|
||||||
|
makedepends = cargo
|
||||||
|
depends = vpnc
|
||||||
|
depends = openssl
|
||||||
|
depends = webkit2gtk-4.1
|
||||||
|
depends = libappindicator-gtk3
|
||||||
|
depends = libsecret
|
||||||
|
depends = libxml2
|
||||||
|
depends = shared-mime-info
|
||||||
|
depends = desktop-file-utils
|
||||||
|
optdepends = wmctrl: for window management
|
||||||
|
provides = globalprotect-openconnect
|
||||||
|
provides = gpclient
|
||||||
|
provides = gpservice
|
||||||
|
provides = gpauth
|
||||||
|
provides = gpgui
|
||||||
|
conflicts = globalprotect-openconnect
|
||||||
|
options = !strip
|
||||||
|
source = globalprotect-openconnect::git+https://github.com/yuezk/GlobalProtect-openconnect.git#branch=main
|
||||||
|
sha256sums = SKIP
|
||||||
|
|
||||||
|
pkgname = globalprotect-openconnect-git
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
# Maintainer: Kevin Yue <[email protected]>
|
||||||
|
|
||||||
|
_pkgname_prefix=globalprotect-openconnect
|
||||||
|
pkgname="${_pkgname_prefix}-git"
|
||||||
|
pkgver=2.5.1.r1.g24f9bbb
|
||||||
|
pkgrel=2
|
||||||
|
pkgdesc="A GUI client for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method."
|
||||||
|
arch=(x86_64 aarch64)
|
||||||
|
url="https://github.com/yuezk/GlobalProtect-openconnect"
|
||||||
|
license=('GPL3')
|
||||||
|
|
||||||
|
makedepends=(git pkg-config 'openconnect>=8.20' webkit2gtk-4.1 curl wget file openssl appmenu-gtk-module libappindicator-gtk3 librsvg libsecret cargo)
|
||||||
|
depends=(vpnc openssl webkit2gtk-4.1 libappindicator-gtk3 libsecret libxml2 shared-mime-info desktop-file-utils)
|
||||||
|
optdepends=('wmctrl: for window management')
|
||||||
|
|
||||||
|
conflicts=('globalprotect-openconnect')
|
||||||
|
provides=('globalprotect-openconnect' 'gpclient' 'gpservice' 'gpauth' 'gpgui')
|
||||||
|
|
||||||
|
install=gp.install
|
||||||
|
|
||||||
|
source=("${_pkgname_prefix}::git+https://github.com/yuezk/GlobalProtect-openconnect.git#branch=main")
|
||||||
|
|
||||||
|
sha256sums=("SKIP")
|
||||||
|
|
||||||
|
options=('!strip')
|
||||||
|
|
||||||
|
pkgver() {
|
||||||
|
cd "${_pkgname_prefix}"
|
||||||
|
|
||||||
|
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "${_pkgname_prefix}"
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
# Must unset the CFLAGS, otherwise the build fails on linking openssl, don't know why
|
||||||
|
unset CFLAGS
|
||||||
|
|
||||||
|
cd "${_pkgname_prefix}"
|
||||||
|
cargo build --frozen --release
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "${_pkgname_prefix}"
|
||||||
|
|
||||||
|
DESTDIR="$pkgdir" make install
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
post_install() {
|
||||||
|
update-mime-database /usr/share/mime
|
||||||
|
update-desktop-database -q
|
||||||
|
}
|
||||||
|
|
||||||
|
pre_upgrade() {
|
||||||
|
rm -f /usr/bin/gpgui
|
||||||
|
}
|
||||||
|
|
||||||
|
post_upgrade() {
|
||||||
|
update-mime-database /usr/share/mime
|
||||||
|
update-desktop-database -q
|
||||||
|
}
|
||||||
|
|
||||||
|
post_remove() {
|
||||||
|
rm -f /usr/bin/gpgui
|
||||||
|
update-mime-database /usr/share/mime
|
||||||
|
update-desktop-database -q
|
||||||
|
}
|
||||||
Reference in new issue
Block a user