This repository was archived by the owner on May 19, 2026. It is now read-only.
fix(collect): ADO PR fetcher supports multiple projects (closes #91) #48
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
| # Continuous Delivery — runs on every push to main. | |
| # | |
| # Pipeline: | |
| # 1. gate — run full test suite (smoke test) | |
| # 2. publish — publish the single `tga` crate to crates.io | |
| # | |
| # Version management: Engineers bump Cargo.toml manually, commit, tag (vX.Y.Z), | |
| # and push. The `release.yml` workflow fires on `v*` tag pushes and builds the | |
| # cross-platform binaries. This CD workflow only publishes to crates.io. | |
| # | |
| # Note: The auto-bump step was removed. It required push rights that | |
| # github-actions[bot] does not have, causing 403 errors on every run. | |
| name: CD | |
| on: | |
| push: | |
| branches: [main] | |
| # Cancel superseded runs (same as ci.yml pattern) | |
| concurrency: | |
| group: cd-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| # ── Job 1: Smoke Test Gate ──────────────────────────────────────────────── | |
| gate: | |
| name: Smoke Test Gate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Format check | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: Tests (skip live integration tests) | |
| run: cargo test -- --skip collect_duetto_frontend | |
| - name: Build release binary | |
| run: cargo build --release --bin tga | |
| # ── Job 2: Publish to crates.io ────────────────────────────────────────── | |
| publish: | |
| name: Publish to crates.io | |
| needs: gate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Read version from Cargo.toml | |
| id: version | |
| run: | | |
| VERSION=$(cargo metadata --no-deps --format-version 1 | \ | |
| python3 -c "import sys,json; print(json.load(sys.stdin)['packages'][0]['version'])") | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "Publishing version: $VERSION" | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Publish tga | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| run: | | |
| VERSION=$(cargo metadata --no-deps --format-version 1 | \ | |
| python3 -c "import sys,json; print(json.load(sys.stdin)['packages'][0]['version'])") | |
| if curl -sf "https://crates.io/api/v1/crates/tga/$VERSION" > /dev/null 2>&1; then | |
| echo "tga $VERSION already published on crates.io, skipping." | |
| else | |
| cargo publish --token "$CARGO_REGISTRY_TOKEN" | |
| fi |