-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
goreleaser isn't happy with older go 1.17 so let's use a manual release notes process
- Loading branch information
1 parent
17370f9
commit 81f6d3d
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Publish Tagged Release | ||
|
||
on: | ||
push: | ||
# run only against tags | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish_release: | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: write # This is required to checkout the code and write releases | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
fetch-tags: true | ||
fetch-depth: 0 | ||
|
||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
|
||
- name: Install asdf & tools | ||
uses: asdf-vm/actions/install@v3 | ||
|
||
- name: Setup build dependencies | ||
run: | | ||
go install github.com/restechnica/semverbot/cmd/sbot@latest | ||
- name: Run Validation | ||
run: task cit | ||
|
||
- name: Read Previous Version | ||
run: echo "last_tag=$(git tag --sort=-version:refname | head -n 2 | tail -n 1)" >> $GITHUB_ENV | ||
|
||
- name: Read Latest Version | ||
run: echo "this_tag=$(git tag --sort=-version:refname | head -n 2 | head -n 1 )" >> $GITHUB_ENV | ||
|
||
- name: Generate Release Notes for this version | ||
id: chglog | ||
run: | | ||
task preview-release-notes | ||
echo "store multiline markdown output as a github env var:" | ||
echo 'release_notes_md<<EOF' >> $GITHUB_ENV | ||
echo "$RELEASE_NOTES_MD" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Publish Release | ||
id: publish_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ env.this_tag }} | ||
release_name: Release ${{ env.this_tag }} | ||
body: ${{ env.release_notes_md }} | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
RELEASE_NOTES.md | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
before: | ||
hooks: | ||
- task cit | ||
|
||
builds: | ||
- skip: true | ||
|
||
#archives: | ||
# - format_overrides: | ||
# - goos: windows | ||
# format: zip | ||
# name_template: >- | ||
# {{- .ProjectName }}_ | ||
# {{- title .Os }}_ | ||
# {{- if eq .Arch "amd64" }}x86_64 | ||
# {{- else if eq .Arch "386" }}i386 | ||
# {{- else }}{{ .Arch }}{{ end }} | ||
# {{- if .Arm }}v{{ .Arm }}{{ end -}} | ||
# | ||
#checksum: | ||
# name_template: 'checksums.txt' | ||
#snapshot: | ||
# name_template: "{{ incpatch .Version }}-next" |