-
Notifications
You must be signed in to change notification settings - Fork 1
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
3 changed files
with
42 additions
and
42 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 |
---|---|---|
@@ -1,15 +1,19 @@ | ||
name: Release to the GitHub Release | ||
name: Release binary 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 | ||
type: choice | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
jobs: | ||
release: | ||
name: Release | ||
release-binary: | ||
name: Release Binary | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Actor | ||
|
@@ -18,19 +22,16 @@ jobs: | |
- name: Check Branch | ||
if: github.ref != 'refs/heads/main' | ||
run: exit 1 | ||
- name: Wait Tests | ||
id: test_result | ||
uses: Sibz/[email protected] | ||
- name: Wait commit status | ||
uses: cloudposse/github-action-wait-commit-status@main | ||
with: | ||
contexts: test-status | ||
authToken: ${{ secrets.GITHUB_TOKEN }} | ||
timeout: 30 | ||
- name: Check Test Result | ||
if: steps.test_result.outputs.result != 'success' | ||
run: | | ||
echo "feiled ${{ steps.test_result.outputs.failedCheckNames }}" | ||
echo "status ${{ steps.test_result.outputs.failedCheckStates }}" | ||
exit 1 | ||
repository: ${{ github.repository }} | ||
sha: ${{ github.sha }} | ||
status: releasable | ||
token: ${{ github.token }} | ||
check-timeout: 120 | ||
check-retry-count: 5 | ||
check-retry-interval: 20 | ||
- name: Checkout Sources | ||
uses: actions/checkout@v4 | ||
- name: Bump-up Semantic Version | ||
|
@@ -41,10 +42,11 @@ jobs: | |
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.19 | ||
go-version: 1.21 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} | ||
with: | ||
version: latest | ||
args: release --clean |
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.19 | ||
go-version: 1.21 | ||
- name: Test Go | ||
run: go test -v --race ./... | ||
test-release: | ||
|
@@ -30,47 +30,45 @@ jobs: | |
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.19 | ||
go-version: 1.21 | ||
- name: Try Bump-up Semantic Version | ||
uses: kyoh86/git-vertag-action@v1 | ||
with: | ||
method: "patch" | ||
- name: Run GoReleaser (dry-run) | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
args: release --clean --skip-publish --snapshot | ||
test-others: | ||
name: Test others | ||
args: release --clean --skip=publish --snapshot | ||
test-diagnostics: | ||
name: Find diagnostics | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.19 | ||
go-version: 1.21 | ||
- name: Search diagnostics | ||
uses: golangci/golangci-lint-action@v4 | ||
with: | ||
version: v1.50.1 | ||
- name: Take coverage | ||
run: go test -coverprofile=coverage.txt -covermode=atomic ./... | ||
- name: Send coverage | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
files: coverage.txt | ||
test-status: | ||
name: Test status | ||
version: v1.55.2 | ||
set-releasable-status: | ||
name: 'Mark commit status "releasable"' | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
- test-others | ||
- test-diagnostics | ||
- test-release | ||
steps: | ||
- name: Set Check Status Success | ||
uses: Sibz/[email protected] | ||
with: | ||
context: test-status | ||
authToken: ${{ secrets.GITHUB_TOKEN }} | ||
state: success | ||
- name: 'Mark commit status "releasable"' | ||
run: | | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | ||
-f state='success' \ | ||
-f description='Mark the commit is able to release binary' \ | ||
-f context='releasable' | ||
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