mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 14:36:15 -05:00
Main changes: - Refactor connect/auth flows around a single OS profile and host identity model, including gateway fallback and cookie-on-stdin handling. - Align request parameters, HIP host-id propagation, SAML webview user-agent behavior, and portal default-browser handling with observed official client behavior. - Add opt-in cookie cache support and Microsoft Defender HIP reporting while keeping host-id validation explicit. - Add BSD build, packaging, release artifact, and provenance support with FreeBSD/OpenBSD path and dependency cleanup. - Update NixOS install documentation and dependency compatibility fixes.
73 lines
1.8 KiB
Bash
Executable File
73 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Usage: ./scripts/gh-release.sh <tag>
|
|
|
|
set -euo pipefail
|
|
shopt -s nullglob
|
|
|
|
REPO="yuezk/GlobalProtect-openconnect"
|
|
TAG=${1:-}
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
|
|
RELEASE_NOTES="Release $TAG"
|
|
|
|
if [ -z "$TAG" ]; then
|
|
echo "Usage: ./scripts/gh-release.sh <tag>"
|
|
exit 1
|
|
fi
|
|
|
|
upload_files() {
|
|
local files=("$@")
|
|
|
|
if [ ${#files[@]} -eq 0 ]; then
|
|
echo "No release assets found to upload"
|
|
exit 1
|
|
fi
|
|
|
|
gh -R "$REPO" release upload "$TAG" "${files[@]}"
|
|
}
|
|
|
|
release_assets() {
|
|
"$SCRIPT_DIR/release-assets.sh" "$TAG"
|
|
}
|
|
|
|
# For snapshot release, we don't create a release, just clear the existing assets and upload new ones.
|
|
# This is to avoid notification spam.
|
|
release_snapshot() {
|
|
RELEASE_NOTES='**!!! DO NOT USE THIS RELEASE IN PRODUCTION !!!**'
|
|
|
|
while IFS= read -r asset; do
|
|
if [ -n "$asset" ]; then
|
|
gh -R "$REPO" release delete-asset "$TAG" "$asset" --yes
|
|
fi
|
|
done < <(gh -R "$REPO" release view "$TAG" --json assets --jq '.assets[].name')
|
|
|
|
echo "Uploading new assets..."
|
|
# Upload all artifacts for snapshot release because we don't need to guarantee stability.
|
|
mapfile -t files < <(release_assets)
|
|
upload_files "${files[@]}"
|
|
}
|
|
|
|
release_tag() {
|
|
echo "Removing existing release..."
|
|
gh -R "$REPO" release delete "$TAG" --yes --cleanup-tag || true
|
|
|
|
echo "Creating release..."
|
|
# Upload source tarballs, GUI components, and BSD packages. Other Linux
|
|
# packages are built in `release.yml` from the standalone source tarball.
|
|
gh -R "$REPO" release create "$TAG" \
|
|
--title "$TAG" \
|
|
--notes "$RELEASE_NOTES"
|
|
|
|
mapfile -t files < <(release_assets)
|
|
upload_files "${files[@]}"
|
|
}
|
|
|
|
if [[ $TAG == *"snapshot" ]]; then
|
|
release_snapshot
|
|
else
|
|
release_tag
|
|
fi
|