This commit is contained in:
Timothy Jaeryang Baek
2026-03-07 20:56:05 -06:00
parent 710b5270a1
commit 124ad948fe

View File

@@ -27,28 +27,17 @@ jobs:
echo "::set-output name=version::$VERSION" echo "::set-output name=version::$VERSION"
- name: Extract latest CHANGELOG entry - name: Extract latest CHANGELOG entry
id: changelog
run: | run: |
CHANGELOG_CONTENT=$(awk 'BEGIN {print_section=0;} /^## \[/ {if (print_section == 0) {print_section=1;} else {exit;}} print_section {print;}' CHANGELOG.md) VERSION="${{ steps.get_version.outputs.version }}"
CHANGELOG_ESCAPED=$(echo "$CHANGELOG_CONTENT" | sed ':a;N;$!ba;s/\n/%0A/g') awk "/^## \[${VERSION}\]/{found=1; next} /^## \[/{if(found) exit} found{print}" CHANGELOG.md > /tmp/release-notes.md
echo "Extracted latest release notes from CHANGELOG.md:"
echo -e "$CHANGELOG_CONTENT"
echo "::set-output name=content::$CHANGELOG_ESCAPED"
- name: Create GitHub release - name: Create GitHub release
uses: actions/github-script@v8 env:
with: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }} run: |
script: | gh release create "v${{ steps.get_version.outputs.version }}" \
const changelog = `${{ steps.changelog.outputs.content }}`; --title "v${{ steps.get_version.outputs.version }}" \
const release = await github.rest.repos.createRelease({ --notes-file /tmp/release-notes.md
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: `v${{ steps.get_version.outputs.version }}`,
name: `v${{ steps.get_version.outputs.version }}`,
body: changelog,
})
console.log(`Created release ${release.data.html_url}`)
- name: Upload package to GitHub release - name: Upload package to GitHub release
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4