Skip to content

Commit

Permalink
chore: generate changelog for release
Browse files Browse the repository at this point in the history
  • Loading branch information
tyhopp committed Sep 21, 2024
1 parent 7d44e7f commit 25c8183
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,27 @@ jobs:
steps:
- name: checkout-code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: set-up-go
uses: actions/setup-go@v5

- name: build
run: make

- name: generate-changelog
id: changelog
run: |
changelog=$(./changelog.sh)
echo "::set-output name=changelog::$changelog"
- name: release
uses: softprops/action-gh-release@v2
with:
files: |
lenv-linux-amd64
lenv-linux-arm64
lenv-windows-amd64.exe
LICENSE
files: |
lenv-linux-amd64
lenv-linux-arm64
lenv-windows-amd64.exe
LICENSE
body: ${{ steps.changelog.outputs.changelog }}
8 changes: 8 additions & 0 deletions changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LATEST_TAG=$(git describe --tags --abbrev=0 HEAD^)
REPO_URL=$(git config --get remote.origin.url)
REPO_URL=${REPO_URL%.git}
REPO_URL=${REPO_URL#git@}
REPO_URL=${REPO_URL#https://}
REPO_URL=${REPO_URL/:/\/}
REPO_URL="https://${REPO_URL}"
git log --pretty=format:"- [%h](${REPO_URL}/commit/%H) %s" ${LATEST_TAG}..HEAD

0 comments on commit 25c8183

Please sign in to comment.