fix: log empty gateway login response headers and handle accordingly #525
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths-ignore: | |
| - LICENSE | |
| - "*.md" | |
| - .vscode | |
| - .devcontainer | |
| branches: | |
| - main | |
| - dev | |
| - hotfix/* | |
| - feature/* | |
| - release/* | |
| tags: | |
| - v*.*.* | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Include arm64 if ref is a tag | |
| setup-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - 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 | |
| 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 | |
| fi | |
| tarball: | |
| runs-on: ubuntu-latest | |
| needs: [setup-matrix] | |
| steps: | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Prepare workspace | |
| run: rm -rf source && mkdir -p source/artifacts | |
| - name: Checkout GlobalProtect-openconnect | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| repository: yuezk/GlobalProtect-openconnect | |
| ref: ${{ github.ref }} | |
| path: source/gp | |
| submodules: recursive | |
| - name: Create tarball | |
| run: | | |
| cd source/gp | |
| # Generate the SNAPSHOT file for non-tagged commits | |
| if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then | |
| touch SNAPSHOT | |
| fi | |
| make tarball | |
| mv -v .build/tarball/*.tar.gz ../artifacts/ | |
| - name: Generate RPM spec file | |
| env: | |
| RELEASE_TAG: ${{ github.ref == 'refs/heads/dev' && 'snapshot' || github.ref_name }} | |
| run: | | |
| cd source/gp | |
| make init-rpm \ | |
| REVISION='1%{?dist}' \ | |
| RPM_SOURCE=https://github.com/yuezk/GlobalProtect-openconnect/releases/download/${RELEASE_TAG}/%{name}-%{version}.tar.gz | |
| mv -v .build/rpm/*.spec ../artifacts/ | |
| - name: Upload tarball | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-source | |
| if-no-files-found: error | |
| path: | | |
| source/artifacts/* | |
| tarball-offline: | |
| if: ${{ github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/') }} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - tarball | |
| steps: | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Prepare workspace | |
| run: rm -rf source-offline && mkdir source-offline | |
| - name: Download tarball | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: artifact-source | |
| path: source-offline | |
| - name: Create offline tarball | |
| run: | | |
| cd source-offline | |
| offline_tarball=$(basename *.tar.gz .tar.gz).offline.tar.gz | |
| # Extract the tarball | |
| tar -xzf *.tar.gz | |
| cd */ | |
| make tarball OFFLINE=1 | |
| # Rename the tarball to .offline.tar.gz | |
| mv -v .build/tarball/*.tar.gz ../$offline_tarball | |
| - name: Upload offline tarball | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: source-offline/*.offline.tar.gz | |
| name: artifact-source-offline | |
| if-no-files-found: error | |
| build-gp: | |
| needs: | |
| - setup-matrix | |
| - tarball | |
| strategy: | |
| matrix: | |
| os: ${{fromJson(needs.setup-matrix.outputs.matrix)}} | |
| package: [deb, rpm, pkg, binary, ubuntu-rolling] | |
| runs-on: ${{ matrix.os.runner }} | |
| name: build-gp (${{ matrix.package }}, ${{ matrix.os.arch }}) | |
| steps: | |
| - name: Prepare workspace | |
| run: | | |
| rm -rf build-gp-${{ matrix.package }} | |
| mkdir -p build-gp-${{ matrix.package }} | |
| - name: Download tarball | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: artifact-source | |
| path: build-gp-${{ matrix.package }} | |
| - name: Docker Login | |
| run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin | |
| - name: Build ${{ matrix.package }} package in Docker | |
| # LIBXML2_STATIC is needed to avoid the dynamic linking issue on different distros | |
| run: | | |
| docker run --pull=always --rm \ | |
| -e COREPACK_INTEGRITY_KEYS=0 \ | |
| -e LIBXML2_STATIC=1 \ | |
| -v $(pwd)/build-gp-${{ matrix.package }}:/workspace \ | |
| yuezk/gpdev:${{ matrix.package }}-builder-tauri2 | |
| - name: Install ${{ matrix.package }} package in Docker | |
| run: | | |
| docker run --pull=always --rm \ | |
| -e COREPACK_INTEGRITY_KEYS=0 \ | |
| -e GPGUI_INSTALLED=0 \ | |
| -v $(pwd)/build-gp-${{ matrix.package }}:/workspace \ | |
| yuezk/gpdev:${{ matrix.package }}-builder-tauri2 \ | |
| bash install.sh | |
| # Don't upload package for ubuntu-rolling because it's duplicate of deb package | |
| - name: Upload ${{ matrix.package }} package | |
| if: ${{ matrix.package != 'ubuntu-rolling' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-gp-${{ matrix.package }}-${{ matrix.os.arch }} | |
| if-no-files-found: error | |
| path: | | |
| build-gp-${{ matrix.package }}/artifacts/* | |
| build-gpgui: | |
| needs: | |
| - setup-matrix | |
| strategy: | |
| matrix: | |
| os: ${{fromJson(needs.setup-matrix.outputs.matrix)}} | |
| runs-on: ${{ matrix.os.runner }} | |
| name: build-gpgui (${{ matrix.os.arch }}) | |
| steps: | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Prepare workspace | |
| run: rm -rf gpgui-source && mkdir gpgui-source | |
| - name: Checkout GlobalProtect-openconnect | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| repository: yuezk/GlobalProtect-openconnect | |
| ref: ${{ github.ref }} | |
| path: gpgui-source/gp | |
| submodules: recursive | |
| - name: Checkout gpgui@${{ github.ref_name }} | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| repository: yuezk/gpgui | |
| ref: ${{ github.ref_name }} | |
| path: gpgui-source/gpgui | |
| - name: Tarball | |
| run: | | |
| cd gpgui-source | |
| tar -czf gpgui.tar.gz gpgui gp | |
| - name: Docker Login | |
| run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin | |
| - name: Build gpgui in Docker | |
| run: | | |
| docker run --pull=always --rm \ | |
| -e COREPACK_INTEGRITY_KEYS=0 \ | |
| -v $(pwd)/gpgui-source:/workspace yuezk/gpdev:gpgui-builder-tauri2 | |
| - name: Install gpgui in Docker | |
| run: | | |
| cd gpgui-source | |
| tar -xJf *.bin.tar.xz | |
| docker run --pull=always --rm \ | |
| -e COREPACK_INTEGRITY_KEYS=0 \ | |
| -v $(pwd):/workspace yuezk/gpdev:gpgui-builder-tauri2 \ | |
| bash -c "cd /workspace/gpgui_*/ && ./gpgui --version" | |
| - name: Upload gpgui | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-gpgui-${{ matrix.os.arch }} | |
| if-no-files-found: error | |
| path: | | |
| gpgui-source/*.bin.tar.xz | |
| gpgui-source/*.bin.tar.xz.sha256 | |
| gh-release: | |
| if: ${{ github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/') }} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - tarball | |
| - tarball-offline | |
| - build-gp | |
| - build-gpgui | |
| steps: | |
| - name: Prepare workspace | |
| run: rm -rf gh-release && mkdir gh-release | |
| - name: Checkout GlobalProtect-openconnect | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| repository: yuezk/GlobalProtect-openconnect | |
| ref: ${{ github.ref }} | |
| path: gh-release/gp | |
| submodules: recursive | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: gh-release/gp/.build/artifacts | |
| - name: Create GH release | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_PAT }} | |
| RELEASE_TAG: ${{ github.ref == 'refs/heads/dev' && 'snapshot' || github.ref_name }} | |
| run: | | |
| cd gh-release/gp/scripts && ./gh-release.sh "$RELEASE_TAG" |