create github action

This commit is contained in:
Bastian Doetsch 2022-03-06 16:32:34 +01:00 committed by GitHub
parent 95e6ac377e
commit 41762c3e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

32
.github/workflows/go.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Go
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Test
run: go test -v ./...
- name: Create release tag
run: |
git tag "v$(git show -s --format=%cd --date=format:%Y%m%d.%H%M%S)"
git push --tags
sudo mv snyk-linux* /usr/local/bin/
- name: Release binaries with GoReleaser
uses: goreleaser/goreleaser-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: release --rm-dist