Skip to content

Commit 1464a8a

Browse files
committed
1 parent 78ac771 commit 1464a8a

File tree

3 files changed

+10
-28
lines changed

3 files changed

+10
-28
lines changed

.github/workflows/releases.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,23 @@ jobs:
1616
with:
1717
go-version: 1.16
1818
- name: Generate changelog
19+
id: changelog
1920
run: |
20-
echo "GORELEASER_CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
21-
git fetch --unshallow
22-
script/changelog | tee CHANGELOG.md
21+
echo "::set-output name=tag-name::${GITHUB_REF#refs/tags/}"
22+
gh api repos/$GITHUB_REPOSITORY/releases/generate-notes \
23+
-f tag_name="${GITHUB_REF#refs/tags/}" \
24+
-f target_commitish=trunk \
25+
-q .body > CHANGELOG.md
26+
env:
27+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2328
- name: Run GoReleaser
2429
uses: goreleaser/goreleaser-action@v2
2530
with:
2631
version: v0.174.1
2732
args: release --release-notes=CHANGELOG.md
2833
env:
2934
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
35+
GORELEASER_CURRENT_TAG: ${{steps.changelog.outputs.tag-name}}
3036
- name: Checkout documentation site
3137
uses: actions/checkout@v2
3238
with:

docs/releasing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Releasing
22

3-
Our build system automatically compiles and attaches cross-platform binaries to any git tag named `vX.Y.Z`. The automated changelog is generated from commit messages starting with “Merge pull request …” that landed between this tag and the previous one (as determined topologically by git).
3+
Our build system automatically compiles and attaches cross-platform binaries to any git tag named `vX.Y.Z`. The changelog is [generated from git commit log](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes).
44

55
Users who run official builds of `gh` on their machines will get notified about the new version within a 24 hour period.
66

script/changelog

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)