-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release new versions through GHA pipeline (#450)
* Create releases via GitHub Actions This uses the GitHub API to create release notes based off tags and PRs that match our current practice. The GoReleaser action requires specifying release notes as a file. The process substituion recommended in their docs is not viable because of how the action expands user-supplied arguments. * Remove outdated build scripts and files * Document automated release process Authored-by: Owen Nelson <[email protected]>
- Loading branch information
1 parent
f9b0c70
commit 7f6f4d9
Showing
12 changed files
with
94 additions
and
192 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
- name: Generate release notes | ||
id: release-notes | ||
uses: actions/github-script@v7 | ||
with: | ||
result-encoding: string | ||
script: | | ||
return github.rest.repos.generateReleaseNotes({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
tag_name: "${{ github.ref_name }}", | ||
}).then(response => response.data.body) | ||
- name: Write release notes to file | ||
run: | | ||
cat << EOF > release-notes.md | ||
${{ steps.release-notes.outputs.result }} | ||
EOF | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --clean --release-notes release-notes.md | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -2,34 +2,29 @@ name: Test | |
|
||
on: | ||
push: | ||
branches: '**' | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Test | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Talisman Maintainers" | ||
go test -covermode=count -coverprofile=coverage.out -v ./... | ||
- name: Codecov | ||
# You may pin to the exact commit or the version. | ||
# uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649 | ||
uses: codecov/[email protected] | ||
|
||
- name: Install bash_unit | ||
run: bash <(curl -s https://raw.githubusercontent.com/pgrange/bash_unit/master/install.sh) | ||
|
||
- name: Test install script | ||
run: ./bash_unit test-install.sh | ||
- uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
- name: Test | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Talisman Maintainers" | ||
go test -covermode=count -coverprofile=coverage.out -v ./... | ||
- name: Codecov | ||
# You may pin to the exact commit or the version. | ||
# uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649 | ||
uses: codecov/[email protected] | ||
- name: Install bash_unit | ||
run: bash <(curl -s https://raw.githubusercontent.com/pgrange/bash_unit/master/install.sh) | ||
- name: Test install script | ||
run: ./bash_unit test-install.sh |
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 |
---|---|---|
|
@@ -48,3 +48,4 @@ out/ | |
# Go workspace file | ||
go.work | ||
|
||
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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