chore: add github release

main
sudo pacman -Syu 2022-04-13 15:26:32 +07:00
parent 05ab47cf75
commit c01af77a99
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
3 changed files with 65 additions and 5 deletions

View File

@ -14,10 +14,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2 - uses: actions/setup-go@v2
with: with:
go-version: "~1.16" go-version: "~1.18"
- run: go test -race ./... - run: go test -race -coverprofile=coverage.out ./...
build: build:
name: Build name: Build
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -28,13 +30,24 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-go@v2 - uses: actions/setup-go@v2
with: with:
go-version: "~1.16" go-version: "~1.18"
- run: go build - run: go build
lint: golangci-lint:
name: Lint name: golangci-lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@v2 - uses: golangci/golangci-lint-action@v2
with: with:
version: latest version: latest
semgrep:
name: semgrep
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
with:
config: >-
p/security-audit
p/secrets
p/golang

27
.github/workflows/goreleaser.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
name: goreleaser
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: "~1.18"
- uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

20
.goreleaser.yml Normal file
View File

@ -0,0 +1,20 @@
before:
hooks:
- go mod tidy
builds:
- main: .
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
universal_binaries:
- replace: true
archives:
- format_overrides:
- goos: windows
format: zip
changelog:
skip: true