From 2198c9f787c9a0bb3e81c9900552b4ffb1407942 Mon Sep 17 00:00:00 2001 From: alice pellerin Date: Sat, 2 May 2026 00:02:50 -0500 Subject: [PATCH] enable publishing on build success --- .github/workflows/publish.yml | 21 --------------------- .github/workflows/release.yml | 26 ++++++++++++-------------- 2 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 0c94a00..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: publish - -on: - workflow_dispatch: - -jobs: - publish: - runs-on: ubuntu-latest - permissions: - id-token: write # Required for OIDC token exchange - steps: - - uses: actions/checkout@v6 - - name: check version - # cut off the v part of the tag to only search for the number - # include the " = " to not match on main, only v* tags - run: grep -q " = \"$(echo "${{ github.ref_name }}" | cut -c2-)\"" Cargo.toml - - uses: rust-lang/crates-io-auth-action@v1 - id: auth - - run: cargo publish - env: - CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75d80fa..b1c5f08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,18 +71,16 @@ jobs: publish: runs-on: ubuntu-latest needs: release + permissions: + id-token: write # Required for OIDC token exchange steps: - - run: echo "publish here!" - # permissions: - # id-token: write # Required for OIDC token exchange - # steps: - # - uses: actions/checkout@v6 - # - name: check version - # # cut off the v part of the tag to only search for the number - # # include the " = " to not match on main, only v* tags - # run: grep -q " = \"$(echo "${{ github.ref_name }}" | cut -c2-)\"" Cargo.toml - # - uses: rust-lang/crates-io-auth-action@v1 - # id: auth - # - run: cargo publish - # env: - # CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + - uses: actions/checkout@v6 + - name: check version + # cut off the v part of the tag to only search for the number + # include the " = " to not match on main, only v* tags + run: grep -q " = \"$(echo "${{ github.ref_name }}" | cut -c2-)\"" Cargo.toml + - uses: rust-lang/crates-io-auth-action@v1 + id: auth + - run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}