-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
2 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,58 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- 'v*.*.*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
# You must use a Linux environment when using service containers or container jobs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: Lint check | ||
run: make install-linter lint | ||
- name: Vet check | ||
run: make vet | ||
- name: Tests | ||
run: make test | ||
release-please: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
outputs: | ||
release_created: ${{ steps.release-please.outputs.release_created }} | ||
tag_name: ${{ steps.release-please.outputs.tag_name }} # e.g. v1.0.0 | ||
version: ${{ steps.release-please.outputs.version }} # e.g. 1.0.0 | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release-please | ||
with: | ||
release-type: go | ||
command: manifest | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: [build, release-please] | ||
if: needs.release-please.outputs.release_created | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
- uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
args: release --clean --skip-sign --skip-validate | ||
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