Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Make releases from tags
name: Publish to crates.io and create GitHub release
on:
push:
tags: ['v*']
Expand All @@ -22,12 +22,12 @@ jobs:
- name: Create release body
id: create_release_body
run: |
RELEASEVERSION="[${{ github.ref_name.slice(1) }}]"
echo "Version: $RELEASEVERSION"
RELEASEBODY=$(awk -v ver="$RELEASEVERSION" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next } } p && NF' CHANGELOG.md)
RELEASE_VERSION="${{ github.ref_name.slice }}"
echo "Version: $RELEASE_VERSION"
RELEASE_BODY=$(awk -v ver="[${RELEASE_VERSION:1}]" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next } } p && NF' CHANGELOG.md)
Comment on lines +25 to +27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RELEASE_VERSION will have a v in it, causing awk not to match the result.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, note the :1 part, it removes the first character.

{
echo 'RELEASEBODY<<EOF'
echo "${RELEASEBODY}"
echo 'RELEASE_BODY<<EOF'
echo "${RELEASE_BODY}"
echo EOF
} >> $GITHUB_OUTPUT

Expand All @@ -36,6 +36,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Creating release for ${{ github.ref_name }}"
echo "${{ steps.create_release_body.outputs.RELEASEBODY }}"
gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --notes "${{ steps.create_release_body.outputs.RELEASEBODY }}"
echo "${{ steps.create_release_body.outputs.RELEASE_BODY }}"
gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --notes "${{ steps.create_release_body.outputs.RELEASE_BODY }}"
echo "Release created successfully"