-
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.
- Loading branch information
1 parent
245c9eb
commit 5e8ebcb
Showing
4 changed files
with
128 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,13 @@ | ||
version: 2 | ||
updates: | ||
- directory: / | ||
package-ecosystem: "gomod" | ||
schedule: | ||
interval: "weekly" | ||
day: "monday" | ||
time: "10:00" | ||
target-branch: "develop" | ||
groups: | ||
dev-dependencies: | ||
patterns: | ||
- "*" |
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,21 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.22 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3.4.0 | ||
with: | ||
version: latest |
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,55 @@ | ||
name: release cli to the GitHub Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
method: | ||
description: | | ||
Which number to increment in the semantic versioning. | ||
Set 'major', 'minor', or 'patch'. | ||
required: true | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check actor | ||
if: github.actor != 'JunNishimura' | ||
run: exit 1 | ||
- name: check branch | ||
if: github.ref != 'refs/heads/main' | ||
run: exit 1 | ||
- name: wait tests | ||
id: test_result | ||
uses: Sibz/await-status-action@v1.0.1 | ||
with: | ||
contexts: test-status | ||
authToken: ${{ secrets.GITHUB_TOKEN }} | ||
timeout: 30 | ||
- name: check test result | ||
if: steps.test_result.outputs.result != 'success' | ||
run: | | ||
echo "failed ${{ steps.test_result.outputs.failedCheckNames }}" | ||
echo "failed ${{ steps.test_result.outputs.failedCheckStates }}" | ||
exit 1 | ||
- name: checkout sources | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: bump-up semantic version | ||
uses: kyoh86/git-vertag-action@v1.1 | ||
with: | ||
method: "${{ github.event.inputs.method }}" | ||
- name: setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
- name: run goreleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} | ||
with: | ||
args: release --rm-dist |
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: test | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
test: | ||
name: test | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 3 | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: setup Golang | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.22 | ||
- name: get dependencies | ||
run: go get -v -t -d ./... | ||
- name: test code | ||
run: go test ./... | ||
|
||
test-status: | ||
name: test status | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: set check status success | ||
uses: Sibz/github-status-action@v1 | ||
with: | ||
context: test-status | ||
authToken: ${{ secrets.GITHUB_TOKEN }} | ||
state: success |