Merge pull request #2 from 01node/micovi-patch-2 #6
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
name: Build and Release | |
on: | |
push: | |
branches: [ master ] | |
tags: [ '*.*.*' ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.17.0' | |
- name: Tidy | |
run: | | |
go mod tidy | |
- name: Build | |
run: | | |
go build | |
- name: Test | |
run: | | |
go test -race -shuffle=on | |
github-publish: | |
# Only publish if all other jobs succeed | |
needs: | |
- test | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.20.0' | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
version: latest | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |