This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
41c2623
commit 2a66855
Showing
3 changed files
with
116 additions
and
95 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,92 +1,53 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/ | ||
pull_request: | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- uses: actions/setup-go@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- name: Format Test | ||
go-version-file: './go.mod' | ||
cache: true | ||
|
||
- name: Check Go Format | ||
run: make fmtcheck | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- uses: actions/setup-go@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- name: Tests | ||
go-version-file: './go.mod' | ||
cache: true | ||
|
||
- name: Run Tests | ||
run: make test | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Branch Info | ||
id: branch_info | ||
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- uses: actions/setup-go@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- name: Deps | ||
go-version-file: './go.mod' | ||
cache: true | ||
|
||
- name: Install GOX | ||
run: go install github.com/mitchellh/gox@latest | ||
- name: Build | ||
run: env RELEASE_TAG=${{ steps.branch_info.outputs.TAG }} make release | ||
- name: Build Files | ||
run: ls ${{ github.workspace }}/dist | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ github.workspace }}/dist | ||
key: build-go-${{ hashFiles('**/*.sha256') }} | ||
restore-keys: | | ||
build-go- | ||
|
||
release: | ||
needs: | ||
- format | ||
- test | ||
- build | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ github.workspace }}/dist | ||
key: build-go-${{ hashFiles('**/*.sha256') }} | ||
restore-keys: | | ||
build-go- | ||
- name: List Files | ||
run: ls ${{ github.workspace }}/dist | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ github.workspace }}/dist/* | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Multi-target Build | ||
run: make release |
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,34 @@ | ||
name: release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: "${{ github.workspace }}/go.mod" | ||
cache: true | ||
|
||
- name: Install GOX | ||
run: go install github.com/mitchellh/gox@latest | ||
|
||
- name: Multi-target Build | ||
run: RELEASE_TAG=${GITHUB_REF#refs/tags/} make release | ||
|
||
- name: List Files | ||
run: ls ${{ github.workspace }}/dist | ||
|
||
- name: Push Files | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ github.workspace }}/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