Skip to content

Commit 9122268

Browse files
committed
auto release with proper name and changelog
1 parent 5ea6d43 commit 9122268

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,32 @@ jobs:
1111
name: Create Release
1212
runs-on: ubuntu-latest
1313
steps:
14+
- name: Get version from tag
15+
id: tag_name
16+
run: |
17+
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
18+
shell: bash
19+
1420
- name: Checkout code
1521
uses: actions/checkout@v2
22+
23+
- name: Get Changelog Entry
24+
id: changelog_reader
25+
uses: mindsers/changelog-reader-action@v2
26+
with:
27+
version: ${{ steps.tag_name.outputs.current_version }}
28+
path: ./CHANGELOG.md
29+
1630
- name: Create Release
1731
id: create_release
1832
uses: actions/create-release@v1
1933
env:
20-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2135
with:
36+
# This pulls from the "Get Changelog Entry" step above, referencing it's ID to get its outputs object.
37+
# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
2238
tag_name: ${{ github.ref }}
23-
release_name: Release ${{ github.ref }}
24-
draft: false
25-
prerelease: false
39+
release_name: COMPAS ${{ steps.changelog_reader.outputs.version }}
40+
body: ${{ steps.changelog_reader.outputs.changes }}
41+
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
42+
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}

0 commit comments

Comments
 (0)