diff --git a/.github/workflows/build-gpgui-nsh-linux.yaml b/.github/workflows/build-gpgui-nsh-linux.yaml new file mode 100644 index 0000000..d357e87 --- /dev/null +++ b/.github/workflows/build-gpgui-nsh-linux.yaml @@ -0,0 +1,102 @@ +name: Build Linux Native Shell + +on: + workflow_call: + inputs: + gp_ref: + required: true + type: string + gpgui_ref: + required: true + type: string + channel: + required: true + type: string + secrets: + GH_PAT: + required: true + +permissions: + contents: read + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - runner: ubuntu-24.04 + arch: x86_64 + - runner: ubuntu-24.04-arm + arch: aarch64 + runs-on: ${{ matrix.runner }} + name: build (${{ matrix.arch }}) + timeout-minutes: 90 + env: + CARGO_INCREMENTAL: '0' + CARGO_BUILD_JOBS: '2' + GPGUI_BUILD_VERSION: ${{ github.run_number }}.${{ github.run_attempt }} + GPGUI_UPDATE_CHANNEL: ${{ inputs.channel }} + GPGUI_LICENSE_SIGNING_KEYS: ${{ vars.GPGUI_LICENSE_SIGNING_KEYS }} + steps: + - name: Checkout GlobalProtect-openconnect + uses: actions/checkout@v6 + with: + ref: ${{ inputs.gp_ref }} + path: source/gp + submodules: recursive + persist-credentials: false + - name: Checkout CI helpers + uses: actions/checkout@v6 + with: + path: .ci + persist-credentials: false + - name: Checkout gpgui + uses: ./.ci/.github/actions/checkout-private + with: + token: ${{ secrets.GH_PAT }} + ref: ${{ inputs.gpgui_ref }} + path: source/gpgui + - name: Install Ubuntu 24.04 dependencies + run: | + sudo apt-get update + sudo apt-get install -y autoconf automake gettext libtool pkg-config \ + clang libclang-dev libgtk-4-dev libicu-dev libxml2-dev libssl-dev \ + libgnutls28-dev liblz4-dev libwayland-dev libxkbcommon-dev + - name: Install the NSH compiler + run: rustup toolchain install 1.97.0 --profile minimal + - name: Cache public crate downloads + uses: actions/cache@v5 + with: + path: | + ~/.cargo/registry/cache + ~/.cargo/registry/index + key: nsh-crates-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('source/gpgui/apps/desktop-nsh/Cargo.lock') }} + restore-keys: nsh-crates-${{ runner.os }}-${{ runner.arch }}- + - name: Build and package Native Shell + run: | + trap 'code=$?; if [ "$code" -ne 0 ]; then echo "::error::Native Shell build failed; diagnostics suppressed."; fi' EXIT + ( + set -euo pipefail + cd source/gpgui + cargo +1.97.0 build --manifest-path apps/desktop-nsh/Cargo.toml --locked \ + --release --bin gpgui-nsh --target-dir target + target/release/gpgui-nsh --version + version="$(cargo +1.97.0 metadata --manifest-path apps/desktop-nsh/Cargo.toml --no-deps --format-version 1 \ + | jq -r '.packages[] | select(.name == "gp-connect-nsh") | .version')" + directory="gpgui-nsh_$version" + archive="gpgui-nsh_$(uname -m).bin.tar.xz" + mkdir -p ".build/package/$directory" + cp target/release/gpgui-nsh ".build/package/$directory/" + tar -cJf ".build/package/$archive" -C .build/package "$directory" + sha256sum ".build/package/$archive" | cut -d ' ' -f 1 > ".build/package/$archive.sha256" + ) >/dev/null 2>&1 + echo "Native Shell build and version check passed." + - name: Upload Native Shell + uses: actions/upload-artifact@v7 + with: + name: artifact-gpgui-nsh-${{ matrix.arch }} + if-no-files-found: error + path: | + source/gpgui/.build/package/*.bin.tar.xz + source/gpgui/.build/package/*.bin.tar.xz.sha256 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 861fd2b..59cd83e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -455,6 +455,16 @@ jobs: secrets: GH_PAT: ${{ secrets.GH_PAT }} + build-gpgui-nsh: + needs: validate-inputs + uses: ./.github/workflows/build-gpgui-nsh-linux.yaml + with: + gp_ref: ${{ needs.validate-inputs.outputs.gp_sha }} + gpgui_ref: ${{ needs.validate-inputs.outputs.gpgui_sha }} + channel: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'stable' }} + secrets: + GH_PAT: ${{ secrets.GH_PAT }} + nix-source: needs: [validate-inputs, build-gpgui-glibc] strategy: @@ -1128,6 +1138,7 @@ jobs: - build-docker-image - build-gpgui-glibc - build-gpgui-musl + - build-gpgui-nsh - setup-bsd-matrix - build-gpgui-frontend - build-bsd diff --git a/.github/workflows/check-nsh.yaml b/.github/workflows/check-nsh.yaml index 61da975..5116b02 100644 --- a/.github/workflows/check-nsh.yaml +++ b/.github/workflows/check-nsh.yaml @@ -110,7 +110,7 @@ jobs: ( set -euo pipefail cd source/gpgui - cargo +1.97.0 check --manifest-path apps/desktop-nsh/Cargo.toml --locked --bin gp-connect-nsh + cargo +1.97.0 check --manifest-path apps/desktop-nsh/Cargo.toml --locked --bin gpgui-nsh ) >/dev/null 2>&1 echo "NSH production check passed." - name: Compile NSH tests