Skip to content

Commit 80b2127

Browse files
authored
ci: split publish and release jobs (#10)
Additionally fixes `RELEASE_VERSION`.
1 parent 957e1f1 commit 80b2127

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
tags: ['v*']
55

66
jobs:
7+
# Source: https://crates.io/docs/trusted-publishing
78
publish:
89
runs-on: ubuntu-latest
9-
# Source: https://crates.io/docs/trusted-publishing
1010
environment: release # Optional: for enhanced security
1111
permissions:
1212
id-token: write # Required for OIDC token exchange
@@ -18,11 +18,14 @@ jobs:
1818
env:
1919
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
2020

21-
# Source: https://medium.com/@usman_qb
21+
# Source: https://medium.com/@usman_qb
22+
release:
23+
runs-on: ubuntu-latest
24+
steps:
2225
- name: Create release body
2326
id: create_release_body
2427
run: |
25-
RELEASE_VERSION="${{ github.ref_name.slice }}"
28+
RELEASE_VERSION="${{ github.ref_name }}"
2629
echo "Version: $RELEASE_VERSION"
2730
RELEASE_BODY=$(awk -v ver="[${RELEASE_VERSION:1}]" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next } } p && NF' CHANGELOG.md)
2831
{
@@ -31,7 +34,7 @@ jobs:
3134
echo EOF
3235
} >> $GITHUB_OUTPUT
3336
34-
- name: Create Release
37+
- name: Create GitHub release
3538
env:
3639
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3740
run: |

0 commit comments

Comments
 (0)