-
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.
feat(ci): add github action workflows for ci and release
- Loading branch information
Adriel Perkins
committed
Jun 20, 2022
1 parent
cb59f4a
commit 60e166b
Showing
5 changed files
with
124 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,39 @@ | ||
name: Go Releaser | ||
|
||
on: | ||
push: | ||
# run only against tags | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
issues: 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@v2 | ||
with: | ||
go-version: 1.18 | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# This is the workflow for the main release branch. | ||
|
||
name: Main Build, Test, and Publish | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
test-check-go: | ||
uses: ./.github/workflows/test-check-go.yaml | ||
|
||
semrelease: | ||
uses: ./.github/workflows/semrelease.yaml | ||
needs: test-check-go | ||
if: | ||
contains(' | ||
refs/heads/main | ||
', github.ref) |
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,22 @@ | ||
# This workflow runs conventional commit checker, semantic release, and goreleaser. | ||
|
||
name: Semantic Release | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
|
||
semrelease: | ||
|
||
name: Sem Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
|
||
- uses: go-semantic-release/action@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
changelog-generator-opt: "emojis=true" |
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,36 @@ | ||
# This workflow runs tests and checks via the makefile against the project | ||
|
||
name: Make Test and Checks | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
|
||
test: | ||
|
||
name: Test and Check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
go install golang.org/x/tools/cmd/goimports@latest | ||
- name: Make Test | ||
run: | | ||
make test | ||
make checks | ||
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