forked from open-webui/open-webui
Merge pull request #1048 from jannikstdl/release-notes
feat: show latest changes in releases
This commit is contained in:
commit
2111398d13
1 changed files with 12 additions and 2 deletions
14
.github/workflows/build-release.yml
vendored
14
.github/workflows/build-release.yml
vendored
|
@ -19,24 +19,34 @@ jobs:
|
||||||
echo "No changes to package.json"
|
echo "No changes to package.json"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
- name: Get version number from package.json
|
- name: Get version number from package.json
|
||||||
id: get_version
|
id: get_version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(jq -r '.version' package.json)
|
VERSION=$(jq -r '.version' package.json)
|
||||||
echo "::set-output name=version::$VERSION"
|
echo "::set-output name=version::$VERSION"
|
||||||
|
|
||||||
|
- name: Extract latest CHANGELOG entry
|
||||||
|
id: changelog
|
||||||
|
run: |
|
||||||
|
CHANGELOG_CONTENT=$(awk '/^## \[/{n++} n==1' CHANGELOG.md)
|
||||||
|
echo "CHANGELOG_CONTENT<<EOF"
|
||||||
|
echo "$CHANGELOG_CONTENT"
|
||||||
|
echo "EOF"
|
||||||
|
echo "::set-output name=content::${CHANGELOG_CONTENT}"
|
||||||
|
|
||||||
- name: Create GitHub release
|
- name: Create GitHub release
|
||||||
uses: actions/github-script@v5
|
uses: actions/github-script@v5
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
|
const changelog = `${{ steps.changelog.outputs.content }}`;
|
||||||
const release = await github.rest.repos.createRelease({
|
const release = await github.rest.repos.createRelease({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
tag_name: `v${{ steps.get_version.outputs.version }}`,
|
tag_name: `v${{ steps.get_version.outputs.version }}`,
|
||||||
name: `v${{ steps.get_version.outputs.version }}`,
|
name: `v${{ steps.get_version.outputs.version }}`,
|
||||||
body: 'Automatically created new release',
|
body: changelog,
|
||||||
})
|
})
|
||||||
console.log(`Created release ${release.data.html_url}`)
|
console.log(`Created release ${release.data.html_url}`)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue