Repository navigation
version bump to v2.15.3 #172
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
| # Publish cyt-indexer to crates.io when a semver tag vX.Y.Z is pushed (not on branch commits). | |
| # | |
| # One-time setup (repository maintainer with admin access): | |
| # | |
| # 1. crates.io — Trusted Publisher (https://crates.io/crates/cyt-indexer/settings/publishing): | |
| # - Crate: cyt-indexer (must have at least one manual publish first) | |
| # - Owner: qdrddr | |
| # - Repository: clear-your-tools | |
| # - Workflow: publish-crates.yml | |
| # - Environment name: crates | |
| # | |
| # 2. GitHub — Environment (Settings → Environments → New environment): | |
| # - Name: crates | |
| # - Optional: required reviewers, wait timer, deployment branch rule (main only) | |
| # - No secrets needed when using crates.io trusted publishing (OIDC) | |
| # | |
| # 3. Push a semver tag: v0.2.0, v1.0.0 (exact form vX.Y.Z only). On success, | |
| # these run in parallel on tag push: | |
| # 1. Publish C FFI artifacts to GitHub Release (publish-c-ffi.yml) | |
| # 2. Publish cyt-indexer-sdk to npm (publish-npm-sdk.yml) | |
| # 2. Publish cyt-indexer-sdk to PyPI (publish-pypi-sdk.yml) | |
| # 4. E2E published packages (e2e-published-sdk.yml) | |
| # | |
| # See RFC 3691: https://rust-lang.github.io/rfcs/3691-trusted-publishing-cratesio.html | |
| name: 1. Publish cyt-indexer to crates.io | |
| on: | |
| push: | |
| tags: | |
| # GitHub glob: digits only, no prerelease suffix (validated again in the job). | |
| - "v[0-9]*.[0-9]*.[0-9]*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish-crate: | |
| name: Upload cyt-indexer to crates.io | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: crates | |
| url: https://crates.io/crates/cyt-indexer | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Prepare Cargo workspace for CI | |
| run: bash scripts/ci/prepare-cargo-workspace.sh | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-edit | |
| run: cargo install cargo-edit --locked | |
| - name: Validate tag format | |
| if: github.event_name == 'push' | |
| shell: bash | |
| run: | | |
| TAG="${{ github.ref_name }}" | |
| if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "::error::Tag must be vX.Y.Z (e.g. v0.1.2), got: ${TAG}" | |
| exit 1 | |
| fi | |
| - name: Set version from tag | |
| if: github.event_name == 'push' | |
| shell: bash | |
| working-directory: sdk/rust/cyt-indexer | |
| run: | | |
| TAG="${{ github.ref_name }}" | |
| VERSION="${TAG#v}" | |
| echo "Setting cyt-indexer version to ${VERSION} (from tag ${TAG})" | |
| cargo set-version "$VERSION" | |
| - name: Test crate | |
| run: cargo test -p cyt-indexer --features testing,ffi | |
| - name: Authenticate with crates.io | |
| id: auth | |
| uses: rust-lang/crates-io-auth-action@v1 | |
| - name: Publish to crates.io | |
| working-directory: sdk/rust/cyt-indexer | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} | |
| # set-version mutates Cargo.toml in CI; publish the tag-aligned version from the checkout. | |
| run: cargo publish --allow-dirty | |
| - name: Prepare release version metadata | |
| if: github.event_name == 'push' | |
| run: | | |
| TAG="${{ github.ref_name }}" | |
| VERSION="${TAG#v}" | |
| printf '%s' "${VERSION}" > cyt-release-version.txt | |
| - name: Store release version artifact | |
| if: github.event_name == 'push' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: cyt-release-version | |
| path: cyt-release-version.txt | |
| if-no-files-found: error |