Skip to content

fix(ci): use working-directory for fmt to avoid multiple workspace roots #2

fix(ci): use working-directory for fmt to avoid multiple workspace roots

fix(ci): use working-directory for fmt to avoid multiple workspace roots #2

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
# ───────────────────────────────────────────────
# Gate: CI checks must pass before any publishing
# ───────────────────────────────────────────────
ci:
name: CI Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup workspace context
run: bash .github/setup-workspace.sh
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Format check
working-directory: crates/search
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -p a3s-search --no-default-features -- -D warnings
- name: Tests
run: cargo test -p a3s-search --no-default-features --lib
# ───────────────────────────────────────────────
# Publish core crate to crates.io
# ───────────────────────────────────────────────
publish-crate:
name: Publish to crates.io
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup workspace context
run: bash .github/setup-workspace.sh
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Publish
working-directory: crates/search
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: cargo publish --allow-dirty
# ───────────────────────────────────────────────
# Create GitHub Release with auto-generated notes
# ───────────────────────────────────────────────
github-release:
name: GitHub Release
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Generate release notes
id: notes
run: |
PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | head -2 | tail -1)
if [ -z "$PREV_TAG" ]; then
NOTES="Initial release"
else
NOTES=$(git log "${PREV_TAG}..HEAD" --oneline --no-merges --pretty=format:"- %s" | head -50)
fi
# Write to file to avoid quoting issues
echo "$NOTES" > /tmp/release-notes.md
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--notes-file /tmp/release-notes.md
# ───────────────────────────────────────────────
# Build and publish Node SDK to npm (7 platforms)
# ───────────────────────────────────────────────
publish-node:
name: Node SDK
needs: ci
uses: ./.github/workflows/publish-node.yml
secrets: inherit
# ───────────────────────────────────────────────
# Build and publish Python SDK to PyPI (7 platforms)
# ───────────────────────────────────────────────
publish-python:
name: Python SDK
needs: ci
uses: ./.github/workflows/publish-python.yml
secrets: inherit