Skip to content

Commit

Permalink
Add relaese workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
x-color committed May 17, 2021
1 parent 922fb56 commit 0b1c7b8
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v2.5.2

test:
name: Test
needs: lint
strategy:
max-parallel: 3
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Test Go
run: go test .

release:
name: Release
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
before:
hooks:
- go mod tidy

builds:
- main: .
ldflags:
- -s -w
- -X main.version={{.Version}}
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64

0 comments on commit 0b1c7b8

Please sign in to comment.