ci: add Alpine APK packaging

This commit is contained in:
Kevin Yue committed 2026-05-08 22:24:15 +08:00
1 parent 966bcc554b
commit a3f2224952
5 files changed
+111 -1

No files matched your search

+1 -1
View File
@@ -143,7 +143,7 @@ jobs:
strategy:
matrix:
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
package: [deb, rpm, pkg, binary, ubuntu-rolling]
package: [deb, rpm, pkg, apk, binary, ubuntu-rolling]
runs-on: ${{ matrix.os.runner }}
name: build-gp (${{ matrix.package }}, ${{ matrix.os.arch }})
steps:
+5
View File
@@ -30,6 +30,11 @@ on:
description: 'Build PKG package'
required: true
default: true
release-apk:
type: boolean
description: 'Build APK package'
required: true
default: true
release-binary:
type: boolean
description: 'Build binary package'
+20
View File
@@ -270,6 +270,26 @@ init-pkgbuild: clean-pkgbuild tarball
pkgbuild: init-pkgbuild
cd .build/pkgbuild && makepkg -s --noconfirm
clean-apk:
rm -rf .build/apk
init-apk: clean-apk tarball
mkdir -p .build/apk
cp .build/tarball/${PKG}.tar.gz .build/apk
cp packaging/apk/APKBUILD.in .build/apk/APKBUILD
sed -i "s/@PKG_NAME@/$(PKG_NAME)/g" .build/apk/APKBUILD
sed -i "s/@VERSION@/$(VERSION)/g" .build/apk/APKBUILD
sed -i "s/@REVISION@/$(REVISION)/g" .build/apk/APKBUILD
checksum=$$(sha512sum .build/apk/${PKG}.tar.gz | cut -d' ' -f1); \
sed -i "s/@SHA512@/$$checksum/g" .build/apk/APKBUILD
apk: init-apk
cd .build/apk && abuild -r -P "$(CURDIR)/.build/apk/packages"
find .build/apk/packages -type f -name "$(PKG_NAME)-*.apk" -exec cp {} .build/apk \;
clean-binary:
rm -rf .build/binary
+11
View File
@@ -20,6 +20,7 @@ A modern GlobalProtect VPN client for Linux, built on OpenConnect with full supp
- [Fedora 38+ / Rawhide](#fedora-38--rawhide)
- [openSUSE Leap 15.6+ / Tumbleweed](#opensuse-leap-156--tumbleweed)
- [Other RPM-based Distributions](#other-rpm-based-distributions)
- [Alpine Linux](#alpine-linux)
- [Gentoo](#gentoo)
- [NixOS](#nixos)
- [Other Distributions](#other-distributions)
@@ -186,6 +187,16 @@ Download the latest RPM package from the [releases](https://github.com/yuezk/Glo
sudo rpm -i globalprotect-openconnect-*.rpm
```
### Alpine Linux
Download the latest `.apk` package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install:
```bash
sudo apk add --allow-untrusted globalprotect-openconnect-*.apk
```
The package uses Alpine's native musl build. Make sure the `community` repository is enabled so GUI dependencies such as `webkit2gtk-4.1`, `libsecret`, and `libayatana-appindicator` can be resolved. GUI-launched connections use polkit, and VPN tunnel creation requires `/dev/net/tun`.
### Gentoo
Available via the `guru` and `lamdness` overlays:
+74
View File
@@ -0,0 +1,74 @@
# Maintainer: Kevin Yue <[email protected]>
pkgname=@PKG_NAME@
pkgver=@VERSION@
pkgrel=@REVISION@
pkgdesc="A GUI client for GlobalProtect VPN, based on OpenConnect, supports the SSO authentication method."
url="https://github.com/yuezk/GlobalProtect-openconnect"
arch="x86_64 aarch64"
license="GPL-3.0-only"
depends="
gmp
gnutls
libayatana-appindicator
libsecret
libxml2
lz4
nettle
openssl
p11-kit
polkit
webkit2gtk-4.1
xdg-utils
zlib
"
makedepends="
autoconf
automake
cargo
file
gettext-dev
gmp-dev
gnutls-dev
gtk+3.0-dev
libayatana-appindicator-dev
libsecret-dev
librsvg-dev
libtool
libxml2-dev
lz4-dev
make
nettle-dev
openssl-dev
p11-kit-dev
patch
pkgconf
zlib-dev
"
source="$pkgname-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"
options="!check"
build() {
cd "$builddir"
unset CFLAGS
unset RUSTFLAGS
make build \
INCLUDE_GUI="${INCLUDE_GUI:-0}" \
BUILD_GUI_HELPER="${BUILD_GUI_HELPER:-1}" \
LIBXML2_STATIC="${LIBXML2_STATIC:-1}"
}
package() {
cd "$builddir"
make install \
DESTDIR="$pkgdir" \
BUILD_GUI_HELPER="${BUILD_GUI_HELPER:-1}"
}
sha512sums="
@SHA512@ $pkgname-$pkgver.tar.gz
"