From d8a4513571c8377b52c08f997d7a924085663beb Mon Sep 17 00:00:00 2001 From: Nathan Fox Date: Fri, 22 May 2026 13:12:38 -0400 Subject: [PATCH 1/2] auto-run publish job --- .github/workflows/publish-crate.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-crate.yml b/.github/workflows/publish-crate.yml index 0a6360a4..0c6a7c1f 100644 --- a/.github/workflows/publish-crate.yml +++ b/.github/workflows/publish-crate.yml @@ -1,6 +1,9 @@ name: Publish Crate on: + push: + branches: + - main workflow_dispatch: inputs: base_version: @@ -32,7 +35,7 @@ jobs: run: | short_sha="$(git rev-parse --short=12 HEAD)" date_stamp="$(date -u +%Y%m%d)" - version="${{ inputs.base_version }}-${date_stamp}-${short_sha}" + version="${{ inputs.base_version || '0.1.0' }}-${date_stamp}-${short_sha}" echo "version=${version}" >> "$GITHUB_OUTPUT" echo "Publishing version ${version}" @@ -62,12 +65,12 @@ jobs: run: cargo package --manifest-path="sds/Cargo.toml" --allow-dirty - name: Authenticate with crates.io - if: ${{ !inputs.dry_run }} + if: ${{ !inputs.dry_run || inputs.dry_run == 'false' }} id: auth uses: rust-lang/crates-io-auth-action@v1 - name: Publish to crates.io - if: ${{ !inputs.dry_run }} + if: ${{ !inputs.dry_run || inputs.dry_run == 'false' }} env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} run: cargo publish --manifest-path="sds/Cargo.toml" --allow-dirty From 9416c55f93241862a9fc7c102586bc2479852184 Mon Sep 17 00:00:00 2001 From: Nathan Fox Date: Fri, 22 May 2026 14:27:08 -0400 Subject: [PATCH 2/2] cleanup --- .github/workflows/publish-crate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-crate.yml b/.github/workflows/publish-crate.yml index 0c6a7c1f..d9cfd6f8 100644 --- a/.github/workflows/publish-crate.yml +++ b/.github/workflows/publish-crate.yml @@ -65,12 +65,12 @@ jobs: run: cargo package --manifest-path="sds/Cargo.toml" --allow-dirty - name: Authenticate with crates.io - if: ${{ !inputs.dry_run || inputs.dry_run == 'false' }} + if: ${{ github.event_name == 'push' || !inputs.dry_run }} id: auth uses: rust-lang/crates-io-auth-action@v1 - name: Publish to crates.io - if: ${{ !inputs.dry_run || inputs.dry_run == 'false' }} + if: ${{ github.event_name == 'push' || !inputs.dry_run }} env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} run: cargo publish --manifest-path="sds/Cargo.toml" --allow-dirty