Skip to content

Merge pull request #3 from 01node/patch-releaser #9

Merge pull request #3 from 01node/patch-releaser

Merge pull request #3 from 01node/patch-releaser #9

Workflow file for this run

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 }}