This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Remove RC metadata validation step from HuggingFace workflow #22
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: HuggingFace Bridge Artifacts | |
| on: | |
| push: | |
| tags: | |
| - 'hf-v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version number without the hf- prefix (optional for manual runs)' | |
| required: false | |
| type: string | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CRATE_DIR: .ext/hf_bridge | |
| permissions: | |
| contents: write | |
| jobs: | |
| prepare: | |
| name: Determine Version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.resolve-version.outputs.version }} | |
| steps: | |
| - name: Resolve release version | |
| id: resolve-version | |
| env: | |
| INPUT_VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| version="${INPUT_VERSION}" | |
| if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| if [[ "${GITHUB_REF_NAME}" == hf-* ]]; then | |
| version="${GITHUB_REF_NAME#hf-}" | |
| else | |
| echo "Tag ${GITHUB_REF_NAME} is not prefixed with hf-." >&2 | |
| exit 1 | |
| fi | |
| fi | |
| if [[ -z "${version}" ]]; then | |
| echo "Version must be provided via hf-* tag or manual input." >&2 | |
| exit 1 | |
| fi | |
| echo "Resolved version: ${version}" | |
| echo "version=${version}" >> "${GITHUB_OUTPUT}" | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| needs: prepare | |
| env: | |
| VERSION: ${{ needs.prepare.outputs.version }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ${{ env.CRATE_DIR }}/target | |
| key: lint-${{ runner.os }}-${{ hashFiles('.ext/hf_bridge/Cargo.lock') }} | |
| - name: Run cargo fmt | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: cargo fmt --all -- --check | |
| - name: Run cargo clippy | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| needs: | |
| - prepare | |
| - lint | |
| env: | |
| VERSION: ${{ needs.prepare.outputs.version }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ${{ env.CRATE_DIR }}/target | |
| key: test-${{ runner.os }}-${{ hashFiles('.ext/hf_bridge/Cargo.lock') }} | |
| - name: Run cargo test | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: cargo test --all-features --release --verbose | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-latest | |
| needs: | |
| - prepare | |
| - test | |
| env: | |
| VERSION: ${{ needs.prepare.outputs.version }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Add coverage dependencies | |
| run: rustup component add llvm-tools-preview | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ${{ env.CRATE_DIR }}/target | |
| key: coverage-${{ runner.os }}-${{ hashFiles('.ext/hf_bridge/Cargo.lock') }} | |
| - name: Install cargo-tarpaulin | |
| run: cargo install cargo-tarpaulin || true | |
| - name: Generate coverage reports | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: | | |
| cargo tarpaulin \ | |
| --all-features \ | |
| --timeout 240 \ | |
| --out Xml \ | |
| --out Html \ | |
| --out Lcov \ | |
| --output-dir coverage | |
| - name: Package coverage artifacts | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: | | |
| tar -czf tokenx-bridge-${VERSION}-coverage.tar.gz coverage | |
| - name: Upload coverage artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tokenx-bridge-${{ env.VERSION }}-coverage | |
| path: ${{ env.CRATE_DIR }}/tokenx-bridge-${{ env.VERSION }}-coverage.tar.gz | |
| if-no-files-found: error | |
| build-linux: | |
| name: Build Linux | |
| runs-on: ubuntu-latest | |
| needs: | |
| - prepare | |
| - test | |
| env: | |
| VERSION: ${{ needs.prepare.outputs.version }} | |
| TARGET: x86_64-unknown-linux-gnu | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Add target | |
| run: rustup target add ${TARGET} | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ${{ env.CRATE_DIR }}/target | |
| key: build-${{ env.TARGET }}-${{ hashFiles('.ext/hf_bridge/Cargo.lock') }} | |
| - name: Build release artifacts | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: cargo build --release --target ${TARGET} | |
| - name: Package binaries | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: | | |
| mkdir -p artifacts | |
| cp target/${TARGET}/release/libtokenx_bridge.so artifacts/ 2>/dev/null || true | |
| cp target/${TARGET}/release/libtokenx_bridge.a artifacts/ 2>/dev/null || true | |
| cp target/${TARGET}/release/libtokenx_bridge.rlib artifacts/ 2>/dev/null || true | |
| if [ -z "$(ls -A artifacts)" ]; then | |
| echo "No build outputs found to package." >&2 | |
| exit 1 | |
| fi | |
| tar -czf tokenx-bridge-${VERSION}-${TARGET}.tar.gz -C artifacts . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }} | |
| path: ${{ env.CRATE_DIR }}/tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }}.tar.gz | |
| if-no-files-found: error | |
| build-windows: | |
| name: Build Windows | |
| runs-on: windows-latest | |
| needs: | |
| - prepare | |
| - test | |
| env: | |
| VERSION: ${{ needs.prepare.outputs.version }} | |
| TARGET: x86_64-pc-windows-msvc | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Add target | |
| shell: pwsh | |
| run: rustup target add $env:TARGET | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~\AppData\Local\Cargo\registry | |
| ~\AppData\Local\Cargo\git | |
| ${{ env.CRATE_DIR }}\target | |
| key: build-${{ env.TARGET }}-${{ hashFiles('.ext/hf_bridge/Cargo.lock') }} | |
| - name: Build release artifacts | |
| working-directory: ${{ env.CRATE_DIR }} | |
| shell: pwsh | |
| run: cargo build --release --target $env:TARGET | |
| - name: Package binaries | |
| working-directory: ${{ env.CRATE_DIR }} | |
| shell: pwsh | |
| run: | | |
| $package = "tokenx-bridge-$env:VERSION-$env:TARGET.zip" | |
| $output = Join-Path -Path (Get-Location) -ChildPath $package | |
| $artifactDir = "artifacts" | |
| New-Item -ItemType Directory -Force -Path $artifactDir | Out-Null | |
| Copy-Item -Path "target/$env:TARGET/release/tokenx_bridge.dll" -Destination $artifactDir -ErrorAction SilentlyContinue | |
| Copy-Item -Path "target/$env:TARGET/release/tokenx_bridge.lib" -Destination $artifactDir -ErrorAction SilentlyContinue | |
| Copy-Item -Path "target/$env:TARGET/release/tokenx_bridge.pdb" -Destination $artifactDir -ErrorAction SilentlyContinue | |
| if (-not (Get-ChildItem $artifactDir)) { | |
| Write-Error "No build outputs found to package." | |
| exit 1 | |
| } | |
| Compress-Archive -Path "$artifactDir/*" -DestinationPath $output -Force | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }} | |
| path: ${{ env.CRATE_DIR }}\tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }}.zip | |
| if-no-files-found: error | |
| build-macos: | |
| name: Build macOS | |
| needs: | |
| - prepare | |
| - test | |
| strategy: | |
| matrix: | |
| include: | |
| - runner: macos-13 | |
| target: x86_64-apple-darwin | |
| - runner: macos-14 | |
| target: aarch64-apple-darwin | |
| runs-on: ${{ matrix.runner }} | |
| env: | |
| VERSION: ${{ needs.prepare.outputs.version }} | |
| TARGET: ${{ matrix.target }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Add target | |
| run: rustup target add ${TARGET} | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ${{ env.CRATE_DIR }}/target | |
| key: build-${{ env.TARGET }}-${{ hashFiles('.ext/hf_bridge/Cargo.lock') }} | |
| - name: Build release artifacts | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: cargo build --release --target ${TARGET} | |
| - name: Package binaries | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: | | |
| mkdir -p artifacts | |
| cp target/${TARGET}/release/libtokenx_bridge.dylib artifacts/ 2>/dev/null || true | |
| cp target/${TARGET}/release/libtokenx_bridge.a artifacts/ 2>/dev/null || true | |
| if [ -z "$(ls -A artifacts)" ]; then | |
| echo "No build outputs found to package." >&2 | |
| exit 1 | |
| fi | |
| tar -czf tokenx-bridge-${VERSION}-${TARGET}.tar.gz -C artifacts . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }} | |
| path: ${{ env.CRATE_DIR }}/tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }}.tar.gz | |
| if-no-files-found: error | |
| build-ios: | |
| name: Build iOS | |
| runs-on: macos-14 | |
| needs: | |
| - prepare | |
| - test | |
| env: | |
| VERSION: ${{ needs.prepare.outputs.version }} | |
| TARGET: aarch64-apple-ios | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Add iOS target | |
| run: rustup target add ${TARGET} | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ${{ env.CRATE_DIR }}/target | |
| key: build-${{ env.TARGET }}-${{ hashFiles('.ext/hf_bridge/Cargo.lock') }} | |
| - name: Build release artifacts | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: cargo build --release --target ${TARGET} | |
| - name: Package binaries | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: | | |
| mkdir -p artifacts | |
| cp target/${TARGET}/release/libtokenx_bridge.a artifacts/ | |
| if [ -z "$(ls -A artifacts)" ]; then | |
| echo "No build outputs found to package." >&2 | |
| exit 1 | |
| fi | |
| tar -czf tokenx-bridge-${VERSION}-${TARGET}.tar.gz -C artifacts . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }} | |
| path: ${{ env.CRATE_DIR }}/tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }}.tar.gz | |
| if-no-files-found: error | |
| build-android: | |
| name: Build Android | |
| runs-on: ubuntu-latest | |
| needs: | |
| - prepare | |
| - test | |
| env: | |
| VERSION: ${{ needs.prepare.outputs.version }} | |
| TARGET: aarch64-linux-android | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Set up Android NDK | |
| id: install-ndk | |
| uses: nttld/setup-ndk@v1 | |
| with: | |
| ndk-version: r26d | |
| - name: Configure Android linker | |
| run: | | |
| ndk_root="${{ steps.install-ndk.outputs.ndk-path }}" | |
| rustup target add ${TARGET} | |
| echo "CC_${TARGET//-/_}=${ndk_root}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang" >> "${GITHUB_ENV}" | |
| echo "CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=${ndk_root}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang" >> "${GITHUB_ENV}" | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ${{ env.CRATE_DIR }}/target | |
| key: build-${{ env.TARGET }}-${{ hashFiles('.ext/hf_bridge/Cargo.lock') }} | |
| - name: Build release artifacts | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: cargo build --release --target ${TARGET} | |
| - name: Package binaries | |
| working-directory: ${{ env.CRATE_DIR }} | |
| run: | | |
| mkdir -p artifacts | |
| cp target/${TARGET}/release/libtokenx_bridge.so artifacts/ | |
| if [ -z "$(ls -A artifacts)" ]; then | |
| echo "No build outputs found to package." >&2 | |
| exit 1 | |
| fi | |
| tar -czf tokenx-bridge-${VERSION}-${TARGET}.tar.gz -C artifacts . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }} | |
| path: ${{ env.CRATE_DIR }}/tokenx-bridge-${{ env.VERSION }}-${{ env.TARGET }}.tar.gz | |
| if-no-files-found: error |