mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-17 13:46:27 -05:00
ci: enhance workflow inputs and series resolution for PPA publishing
This commit is contained in:
2 files changed
+76
-32
No files matched your search
@@ -1,6 +1,15 @@
|
||||
name: Build
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
gp_branch:
|
||||
description: 'GlobalProtect-openconnect branch to use for the snapshot release'
|
||||
required: true
|
||||
default: dev
|
||||
gpgui_branch:
|
||||
description: 'gpgui branch to use for the snapshot release'
|
||||
required: true
|
||||
default: dev
|
||||
push:
|
||||
paths-ignore:
|
||||
- LICENSE
|
||||
@@ -9,7 +18,6 @@ on:
|
||||
- .devcontainer
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- hotfix/*
|
||||
- feature/*
|
||||
- release/*
|
||||
@@ -21,7 +29,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# Include arm64 if ref is a tag
|
||||
# Include arm64 for tagged releases and manual snapshot releases.
|
||||
setup-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
@@ -30,8 +38,8 @@ jobs:
|
||||
- name: Set up matrix
|
||||
id: set-matrix
|
||||
run: |
|
||||
# Set the matrix to include arm64 if the ref is a tag or is the dev branch
|
||||
if [[ "${{ github.ref }}" == "refs/tags/"* || "${{ github.ref }}" == "refs/heads/dev" ]]; then
|
||||
# Set the matrix to include arm64 for tagged releases and manual snapshot releases.
|
||||
if [[ "${{ github.ref }}" == "refs/tags/"* || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||
echo 'matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}, {"runner": "ubuntu-24.04-arm", "arch": "ubuntu-24.04-arm"}]' >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo 'matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}]' >> $GITHUB_OUTPUT
|
||||
@@ -52,7 +60,7 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
repository: yuezk/GlobalProtect-openconnect
|
||||
ref: ${{ github.ref }}
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||
path: source/gp
|
||||
submodules: recursive
|
||||
|
||||
@@ -69,7 +77,7 @@ jobs:
|
||||
|
||||
- name: Generate RPM spec file
|
||||
env:
|
||||
RELEASE_TAG: ${{ github.ref == 'refs/heads/dev' && 'snapshot' || github.ref_name }}
|
||||
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && 'snapshot' || github.ref_name }}
|
||||
run: |
|
||||
cd source/gp
|
||||
|
||||
@@ -88,7 +96,7 @@ jobs:
|
||||
source/artifacts/*
|
||||
|
||||
tarball-offline:
|
||||
if: ${{ github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/') }}
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/') }}
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- tarball
|
||||
@@ -195,15 +203,15 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
repository: yuezk/GlobalProtect-openconnect
|
||||
ref: ${{ github.ref }}
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||
path: gpgui-source/gp
|
||||
submodules: recursive
|
||||
- name: Checkout gpgui@${{ github.ref_name }}
|
||||
- name: Checkout gpgui
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
repository: yuezk/gpgui
|
||||
ref: ${{ github.ref_name }}
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gpgui_branch || github.ref_name }}
|
||||
path: gpgui-source/gpgui
|
||||
- name: Tarball
|
||||
run: |
|
||||
@@ -234,7 +242,7 @@ jobs:
|
||||
gpgui-source/*.bin.tar.xz.sha256
|
||||
|
||||
gh-release:
|
||||
if: ${{ github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/') }}
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/') }}
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- tarball
|
||||
@@ -251,7 +259,7 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
repository: yuezk/GlobalProtect-openconnect
|
||||
ref: ${{ github.ref }}
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.gp_branch || github.ref }}
|
||||
path: gh-release/gp
|
||||
submodules: recursive
|
||||
|
||||
@@ -263,6 +271,6 @@ jobs:
|
||||
- name: Create GH release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_PAT }}
|
||||
RELEASE_TAG: ${{ github.ref == 'refs/heads/dev' && 'snapshot' || github.ref_name }}
|
||||
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && 'snapshot' || github.ref_name }}
|
||||
run: |
|
||||
cd gh-release/gp/scripts && ./gh-release.sh "$RELEASE_TAG"
|
||||
@@ -11,12 +11,7 @@ on:
|
||||
required: false
|
||||
default: "1"
|
||||
series:
|
||||
description: 'Ubuntu series to publish'
|
||||
type: "string"
|
||||
required: false
|
||||
default: ""
|
||||
excluded_series:
|
||||
description: 'Additional Ubuntu series to exclude from publishing'
|
||||
description: 'Space-separated Ubuntu series. Leave empty to publish all supported series.'
|
||||
type: "string"
|
||||
required: false
|
||||
default: ""
|
||||
@@ -30,20 +25,63 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check tag exists
|
||||
uses: mukunku/[email protected]
|
||||
id: check-tag
|
||||
with:
|
||||
tag: ${{ inputs.tag }}
|
||||
- name: Exit if tag does not exist
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ inputs.tag }}
|
||||
run: |
|
||||
if [[ "${{ steps.check-tag.outputs.exists }}" == "false" ]]; then
|
||||
echo "Tag ${{ inputs.tag }} does not exist"
|
||||
if ! gh api "repos/${{ github.repository }}/git/ref/tags/$TAG" >/dev/null 2>&1; then
|
||||
echo "Tag $TAG does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
publish-ppa:
|
||||
resolve-series:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.resolve.outputs.matrix }}
|
||||
steps:
|
||||
- name: Resolve Ubuntu series
|
||||
id: resolve
|
||||
env:
|
||||
INPUT_SERIES: ${{ inputs.series }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y distro-info distro-info-data
|
||||
|
||||
if [[ "$INPUT_SERIES" == *","* ]]; then
|
||||
echo "Use space-separated series, for example: jammy noble" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
series=()
|
||||
if [[ -z "${INPUT_SERIES// }" ]]; then
|
||||
while IFS= read -r item; do
|
||||
[[ -n "$item" ]] && series+=("$item")
|
||||
done < <(ubuntu-distro-info --supported)
|
||||
else
|
||||
read -r -a series <<< "$INPUT_SERIES"
|
||||
fi
|
||||
|
||||
if [[ "${#series[@]}" -eq 0 ]]; then
|
||||
echo "No Ubuntu series resolved" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for item in "${series[@]}"; do
|
||||
ubuntu-distro-info --series "$item" >/dev/null
|
||||
done
|
||||
|
||||
matrix="$(printf '%s\n' "${series[@]}" | jq -R . | jq -s -c '{series: .}')"
|
||||
echo "Resolved matrix: $matrix"
|
||||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
||||
|
||||
publish-ppa:
|
||||
needs: [check, resolve-series]
|
||||
name: publish-ppa (${{ matrix.series }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.resolve-series.outputs.matrix) }}
|
||||
steps:
|
||||
- uses: pnpm/action-setup@v5
|
||||
with:
|
||||
@@ -94,10 +132,8 @@ jobs:
|
||||
gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
|
||||
tarball: publish-ppa/globalprotect-openconnect-*.tar.gz
|
||||
debian_dir: publish-ppa/globalprotect-openconnect-*/.build/debian
|
||||
deb_email: "[email protected]"
|
||||
deb_fullname: "Kevin Yue"
|
||||
deb_email: ${{ vars.DEB_EMAIL }}
|
||||
deb_fullname: ${{ vars.DEB_FULLNAME }}
|
||||
extra_ppa: "yuezk/globalprotect-openconnect"
|
||||
# Ubuntu 18.04 and 20.04 are excluded because tauri2 no longer supports them
|
||||
excluded_series: "bionic focal ${{ inputs.excluded_series }}"
|
||||
series: ${{ inputs.series }}
|
||||
series: ${{ matrix.series }}
|
||||
revision: ${{ inputs.revision }}
|
||||
Reference in new issue
Block a user