Skip to content

Commit

Permalink
use release description and version from real generated changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
brainelectronics committed Oct 12, 2024
1 parent ed163e0 commit ad27898
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,27 @@ jobs:
changelog changelog.md \
--snippets=.snippets \
--dry-run > latest-entry.json
jq -r ".content" latest-entry.json > latest_description.txt
sed -i '/^$/d' latest_description.txt
echo "CHANGELOG_JSON=$(jq -c . < latest-entry.json)" >> $GITHUB_ENV
echo 'LATEST_DESCRIPTION<<"EOT"' >> $GITHUB_OUTPUT
cat latest_description.txt >> $GITHUB_OUTPUT
echo '"EOT"' >> $GITHUB_OUTPUT
echo "latest_version=$(jq -r '.version' latest-entry.json)" >> $GITHUB_ENV
- name: Update changelog with snippets
run: |
poetry run changelog-generator \
changelog changelog.md \
--snippets=.snippets \
--in-place \
--no-internal
poetry run changelog2version \
--changelog_file changelog.md \
--output changelog.json \
--print \
--debug
jq -r ".info.description" changelog.json > latest_description.txt
sed -i '/^$/d' latest_description.txt
echo 'LATEST_DESCRIPTION<<"EOT"' >> $GITHUB_OUTPUT
cat latest_description.txt >> $GITHUB_OUTPUT
echo '"EOT"' >> $GITHUB_OUTPUT
echo "latest_version=$(jq -r '.info.version' changelog.json)" >> $GITHUB_ENV
- name: Build package
run: |
poetry run changelog2version \
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/test-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,27 @@ jobs:
changelog changelog.md \
--snippets=.snippets \
--dry-run > latest-entry.json
jq -r ".content" latest-entry.json > latest_description.txt
sed -i '/^$/d' latest_description.txt
echo "CHANGELOG_JSON=$(jq -c . < latest-entry.json)" >> $GITHUB_ENV
echo 'LATEST_DESCRIPTION<<"EOT"' >> $GITHUB_OUTPUT
cat latest_description.txt >> $GITHUB_OUTPUT
echo '"EOT"' >> $GITHUB_OUTPUT
echo "latest_version=$(jq -r '.version' latest-entry.json)" >> $GITHUB_ENV
- name: Update changelog with snippets
run: |
poetry run changelog-generator \
changelog changelog.md \
--snippets=.snippets \
--in-place \
--no-internal
poetry run changelog2version \
--changelog_file changelog.md \
--output changelog.json \
--print \
--debug
jq -r ".info.description" changelog.json > latest_description.txt
sed -i '/^$/d' latest_description.txt
echo 'LATEST_DESCRIPTION<<"EOT"' >> $GITHUB_OUTPUT
cat latest_description.txt >> $GITHUB_OUTPUT
echo '"EOT"' >> $GITHUB_OUTPUT
echo "latest_version=$(jq -r '.info.version' changelog.json)" >> $GITHUB_ENV
- name: Build package
run: |
poetry run changelog2version \
Expand Down

0 comments on commit ad27898

Please sign in to comment.