Skip to content

Commit 6450330

Browse files
committed
Update publish.yml
1 parent 1b6cf4e commit 6450330

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# https://blog.rust-lang.org/2025/07/11/crates-io-development-update-2025-07/
1+
# smoelius: Based on: https://blog.rust-lang.org/2025/07/11/crates-io-development-update-2025-07/
22

33
name: Publish to crates.io
44

@@ -11,11 +11,32 @@ jobs:
1111
runs-on: ubuntu-latest
1212
environment: release # Optional: for enhanced security
1313
permissions:
14+
contents: write # Required to create GitHub release
1415
id-token: write # Required for OIDC token exchange
1516
steps:
1617
- uses: actions/checkout@v7
18+
with:
19+
fetch-depth: 0
20+
1721
- uses: rust-lang/crates-io-auth-action@v1
1822
id: auth
23+
1924
- run: cargo publish
2025
env:
2126
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
27+
28+
- name: Get version
29+
id: get-version
30+
run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> "$GITHUB_OUTPUT"
31+
32+
- name: Create release notes
33+
run: git log -p -1 CHANGELOG.md | grep '^+\($\|[^+]\)' | cut -c 2- | tee body.md
34+
35+
- name: Create release
36+
uses: softprops/action-gh-release@v3
37+
with:
38+
tag_name: ${{ github.ref }}
39+
name: Release ${{ steps.get-version.outputs.version }}
40+
body_path: body.md
41+
draft: false
42+
prerelease: ${{ contains(github.ref, 'pre') || contains(github.ref, 'rc') }}

0 commit comments

Comments
 (0)