Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoh86 committed Jun 11, 2024
1 parent 0990ad8 commit 7c2915e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 42 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/release.yml
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
Expand All @@ -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
Expand All @@ -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
44 changes: 21 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ brews:
- install: |
bin.install "git-vertag"
man1.install Dir.glob('git-vertag*.1')
tap:
repository:
owner: kyoh86
name: homebrew-tap
folder: Formula
directory: Formula
homepage: https://github.com/kyoh86/git-vertag
description: A tool to manage version-tag with the semantic versioning specification.
license: MIT
Expand Down

0 comments on commit 7c2915e

Please sign in to comment.