-
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.
ci: create github actions workflows (#21)
Signed-off-by: Chris Gianelloni <[email protected]>
- Loading branch information
Showing
5 changed files
with
116 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
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,16 @@ | ||
# The below is pulled from upstream and slightly modified | ||
# https://github.com/webiny/action-conventional-commits/blob/master/README.md#usage | ||
|
||
name: Conventional Commits | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Conventional Commits | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: webiny/[email protected] |
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,24 @@ | ||
name: go-test | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
go-test: | ||
name: go-test | ||
strategy: | ||
matrix: | ||
go-version: [1.21.x, 1.22.x] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: go-test | ||
run: go test ./... |
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,32 @@ | ||
# This file was copied from the following URL and modified: | ||
# https://github.com/golangci/golangci-lint-action/blob/master/README.md#how-to-use | ||
|
||
name: golangci-lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21.x | ||
cache: false | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v4 | ||
with: | ||
args: --timeout=10m | ||
# Only show new issues in a PR but show all issues for pushes | ||
only-new-issues: ${{ github.event_name == 'pull_request' && 'true' || '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,40 @@ | ||
name: publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
concurrency: ${{ github.ref }} | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
RELEASE_ID: ${{ steps.create-release.outputs.result }} | ||
steps: | ||
- run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV" | ||
- uses: actions/github-script@v7 | ||
id: create-release | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
result-encoding: string | ||
script: | | ||
try { | ||
const response = await github.rest.repos.createRelease({ | ||
generate_release_notes: true, | ||
name: process.env.RELEASE_TAG, | ||
owner: context.repo.owner, | ||
prerelease: false, | ||
repo: context.repo.repo, | ||
tag_name: process.env.RELEASE_TAG, | ||
}); | ||
return response.data.id; | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
# This updates the documentation on pkg.go.dev and the latest version available via the Go module proxy | ||
- name: Pull new module version | ||
uses: andrewslotin/[email protected] |