feat: Add WebAuthn/FIDO2/U2F passkey support #7355
Workflow file for this run
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 | |
| permissions: | |
| contents: read | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: x86_64-linux | |
| target: x86_64-unknown-linux-gnu | |
| os: ubuntu-22.04 # older image for glibc compatibility | |
| cyclonedx-build: cyclonedx-linux-x64 | |
| cargo-cross: false | |
| - arch: arm64-linux | |
| target: aarch64-unknown-linux-gnu | |
| os: ubuntu-22.04-arm # older image for glibc compatibility | |
| cyclonedx-build: cyclonedx-linux-arm64 | |
| cargo-cross: false | |
| - arch: x86_64-macos | |
| target: x86_64-apple-darwin | |
| os: macos-latest | |
| cyclonedx-build: cyclonedx-osx-x64 | |
| cargo-cross: false | |
| - arch: arm64-macos | |
| target: aarch64-apple-darwin | |
| os: macos-latest | |
| cyclonedx-build: cyclonedx-osx-arm64 | |
| cargo-cross: true | |
| fail-fast: false | |
| name: Build (${{ matrix.arch }}) | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| artifact-metadata: write | |
| steps: | |
| - if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt update | |
| sudo apt install -y libssl-dev pkg-config | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| submodules: recursive | |
| - uses: rlespinasse/github-slug-action@ef93b2ea4b6405d06fd8684fc3ff795d262ecae8 | |
| - name: Add Rust target | |
| run: rustup target add ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 | |
| with: | |
| key: "build" | |
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 | |
| with: | |
| node-version: 24 | |
| - name: Install tools | |
| run: | | |
| cargo install --locked just@1.4.0 | |
| cargo install --locked cargo-cyclonedx@^0.5 | |
| rm -rf ~/.cargo/registry | |
| - name: Install CycloneDX | |
| run: | | |
| mkdir cdx | |
| wget https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.27.2/${{ matrix.cyclonedx-build }} -O cyclonedx | |
| chmod +x cyclonedx | |
| - name: Install CycloneDX-npm | |
| run: | | |
| cd / | |
| npm i -g @cyclonedx/cyclonedx-npm@4.1.2 | |
| - name: Install admin UI deps | |
| run: | | |
| just npm ci | |
| - name: Build admin UI | |
| run: | | |
| just npm run build | |
| - name: Generate admin UI BOM | |
| run: | | |
| just npm prune | |
| cd warpgate-web && NODE_ENV=dev cyclonedx-npm --output-format xml > ../cdx/admin-ui.cdx.xml | |
| - name: Build | |
| uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 | |
| with: | |
| command: build | |
| use-cross: ${{ matrix.cargo-cross }} | |
| args: --all-features --release --target ${{ matrix.target }} | |
| env: | |
| ENV SOURCE_DATE_EPOCH: "0" # for rust-embed determinism | |
| CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "--cfg tokio_unstable --remap-path-prefix=$HOME=/reproducible-home --remap-path-prefix=$PWD=/reproducible-pwd" | |
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "--cfg tokio_unstable --remap-path-prefix=$HOME=/reproducible-home --remap-path-prefix=$PWD=/reproducible-pwd" | |
| CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS: "--cfg tokio_unstable --remap-path-prefix=$HOME=/reproducible-home --remap-path-prefix=$PWD=/reproducible-pwd" | |
| CARGO_TARGET_AARCH64_APPLE_DARWIN_RUSTFLAGS: "--cfg tokio_unstable --remap-path-prefix=$HOME=/reproducible-home --remap-path-prefix=$PWD=/reproducible-pwd" | |
| - name: Generate Rust BOM | |
| run: | | |
| cargo cyclonedx --all-features | |
| mv warpgate*/*.cdx.xml cdx/ | |
| - name: Merge BOMs | |
| run: ./cyclonedx merge --input-files cdx/* --input-format xml --output-format xml > cdx.xml | |
| - name: Attest build | |
| uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| subject-path: target/${{ matrix.target }}/release/warpgate | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@2848b2cda0e5190984587ec6bb1f36730ca78d50 | |
| with: | |
| name: warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }} | |
| path: target/${{ matrix.target }}/release/warpgate | |
| - name: Upload SBOM | |
| uses: actions/upload-artifact@2848b2cda0e5190984587ec6bb1f36730ca78d50 | |
| with: | |
| name: warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }}.cdx.xml | |
| path: cdx.xml | |
| - name: Rename artifacts | |
| run: | | |
| mkdir dist | |
| mv target/${{ matrix.target }}/release/warpgate dist/warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }} | |
| mv cdx.xml dist/warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }}.cdx.xml | |
| # Updating a release with generate_release_notes appends a fresh copy of the | |
| # generated notes to whatever body is already there, so only ask for them | |
| # while the release has none - otherwise every arch of every rerun grows | |
| # the notes and buries any hand-written ones. | |
| - name: Check for existing release notes | |
| id: release_notes | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| body=$(gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --json body --jq .body 2>/dev/null || true) | |
| if [ -z "$body" ]; then | |
| echo "generate=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "generate=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Upload release | |
| uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| draft: true | |
| generate_release_notes: ${{ steps.release_notes.outputs.generate == 'true' }} | |
| files: dist/* | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| config-schema: | |
| name: Config schema check | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Setup | |
| run: | | |
| sudo apt update | |
| sudo apt install --no-install-recommends -y libssl-dev pkg-config | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| submodules: recursive | |
| - name: Install tools | |
| run: | | |
| cargo install --locked just@1.4.0 | |
| - name: Ensure there are no changes in config schema | |
| run: | | |
| mkdir warpgate-web/dist | |
| just config-schema | |
| git diff --exit-code config-schema.json |