Skip to content

Commit

Permalink
Generate changelog for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
adhamu committed Jan 13, 2023
1 parent 55c8da1 commit 56dc213
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set Environment Variables
run: |
Expand Down Expand Up @@ -57,18 +59,6 @@ jobs:
- name: Build
run: yarn build

- name: Create Release
if: github.ref == 'refs/heads/main'
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
tag_name: ${{ steps.env_vars.outputs.NEW_VERSION }}
release_name: ${{ steps.env_vars.outputs.NEW_VERSION }}
body: "**Full Changelog**: https://github.com/adhamu/arge/compare/${{ steps.env_vars.outputs.PUBLISHED_VERSION }}...${{ steps.env_vars.outputs.NEW_VERSION }}"
draft: false
prerelease: false

- name: Publish to Registry
run: |
pkg_version=${{ steps.env_vars.outputs.NEW_VERSION }}
Expand All @@ -79,4 +69,28 @@ jobs:
yarn publish --tag beta --access public
else
yarn publish --access public
git tag $pkg_version
git push --tags
fi
- name: Create Changeset
run: |
CHANGELOG=$(git --no-pager log ${{ steps.env_vars.outputs.PUBLISHED_VERSION }}..HEAD --format="%C(auto)%h %s")
DELIMITER="$(openssl rand -hex 8)"
echo "RELEASE_NOTES<<${DELIMITER}" >> $GITHUB_OUTPUT
echo -e "$CHANGELOG" >> $GITHUB_OUTPUT
echo "${DELIMITER}" >> $GITHUB_OUTPUT
id: changeset

- name: Create Release
if: github.ref == 'refs/heads/main'
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
tag_name: ${{ steps.env_vars.outputs.NEW_VERSION }}
release_name: ${{ steps.env_vars.outputs.NEW_VERSION }}
body: "${{ steps.changeset.outputs.RELEASE_NOTES }}\n\n**Full Changelog**: https://github.com/adhamu/arge/compare/${{ steps.env_vars.outputs.PUBLISHED_VERSION }}...${{ steps.env_vars.outputs.NEW_VERSION }}"
draft: false
prerelease: false

0 comments on commit 56dc213

Please sign in to comment.