config: add build, lint and release workflows

This commit is contained in:
Mayowa-Ojo 2021-12-16 20:54:50 -07:00
parent aa698113ab
commit 416d6c8cbd
3 changed files with 78 additions and 0 deletions

29
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: build
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
go-version: [~1.16, ^1]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
GO111MODULE: "on"
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
uses: actions/checkout@v2
- name: Download Go modules
run: go mod download
- name: Build
run: go build -v ./...
- name: Test
run: go test ./...

13
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: lint
on: [push, pull_request]
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
args: --issues-exit-code=0

36
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: goreleaser
on:
# pull_request:
push:
tags:
- '*'
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}