Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changelog fixes #114

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
25 changes: 17 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
fi

new_version=$(npm version "$step" -m "[skip ci] Release %s")
echo "::set-output name=release_tag::$new_version"
echo "release_tag=$new_version" >> $GITHUB_OUTPUT
env:
# apparently, putting the message into an env variable first sanitizes it
# (see https://github.com/flowr-analysis/flowr/security/code-scanning/29)
Expand All @@ -53,24 +53,33 @@ jobs:
- name: Package
run: vsce package

# but not the tag as it may be created by the release action
# but not the tag as it is created by the release action
- name: Push version update commmit
run: git push

- name: Get changelog
- name: Get previous tag
id: prev_tag
run: |
prev_tag=$(git describe --tags --abbrev=0)
echo "prev_tag=$prev_tag" >> $GITHUB_OUTPUT
- name: Generate changelog
id: changelog
uses: heinrichreimer/[email protected]
with:
sinceTag: ${{ steps.prev_tag.outputs.prev_tag }}
- name: Add changelog to file
run: |
new_version_tag=${{ steps.version.outputs.release_tag }}
new_version_num=${new_version_tag:1}
changelog=$(awk -v version="$new_version_num" '/# Version / {printit = $3 == version}; printit;' "CHANGELOG.md")
echo "::set-output name=body::$changelog"
changelog=${{ steps.changelog.outputs.changelog }}
release_tag=${{ steps.version.outputs.release_tag }}
echo -e '# Version $release_tag\n$changelog\n\n' >> CHANGELOG.md

- name: GitHub release
uses: softprops/action-gh-release@v2
with:
files: vscode-flowr-*.vsix
token: ${{ secrets.RELEASE_TOKEN }}
tag_name: ${{ steps.version.outputs.release_tag }}
body: ${{ steps.changelog.outputs.body }}
body: ${{ steps.changelog.outputs.changelog }}

- name: Marketplace
run: vsce publish
Expand Down
Loading