Skip to content

Commit d744f21

Browse files
committed
ci: Drop cargo-release from publish workflow, verify tag is on main
cargo-release adds no value over cargo publish when the version is already bumped and tagged. Removing it also removes the detached-HEAD allow-branch awkwardness. Safety is enforced by an explicit check that the release tag's commit is reachable from origin/main.
1 parent d97020f commit d744f21

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ jobs:
1313
contents: read
1414
steps:
1515
- uses: actions/checkout@v4
16-
- uses: dtolnay/rust-toolchain@stable
17-
- uses: taiki-e/install-action@v2
1816
with:
19-
tool: cargo-release
17+
fetch-depth: 0
18+
- name: Verify release tag is on main
19+
run: |
20+
git fetch origin main --depth=1
21+
git merge-base --is-ancestor "$GITHUB_SHA" origin/main
22+
- uses: dtolnay/rust-toolchain@stable
2023
- uses: rust-lang/crates-io-auth-action@v1
2124
id: auth
22-
- run: cargo release publish --execute --no-confirm --allow-branch '*'
25+
- run: cargo publish
2326
env:
2427
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)