Skip to content

Commit

Permalink
build: Github action
Browse files Browse the repository at this point in the history
  • Loading branch information
leonhfr committed Sep 12, 2022
1 parent a74f4f1 commit f8f7e37
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
push:
tags:
- v*
branches:
- master
pull_request:
branches:
- master

jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
cache: true
go-version-file: go.mod

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest

- name: Test
run: go test -v ./...

- name: Build
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --snapshot --rm-dist

release:
needs: checks
if: startsWith(github.event.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
cache: true
go-version-file: go.mod

- name: Release
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f8f7e37

Please sign in to comment.