adding github release workflow
parent
8e9e37ded3
commit
75f625a93e
@ -0,0 +1,47 @@
|
||||
name: goreleaser
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
test:
|
||||
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.20
|
||||
- name: Test
|
||||
run: make test
|
||||
|
||||
goreleaser:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Fetch all tags
|
||||
run: git fetch --force --tags
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.20
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: ${{ env.GITHUB_REF_NAME }}
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
|
@ -0,0 +1,18 @@
|
||||
BINARY_NAME=obp
|
||||
|
||||
build-all:
|
||||
GOOS=darwin GOARCH=amd64 go build -o bin/${BINARY_NAME}-darwin
|
||||
GOOS=linux GOARCH=amd64 go build -o bin/${BINARY_NAME}-linux
|
||||
GOOS=windows GOARCH=amd64 go build -o bin/${BINARY_NAME}-windows.exe
|
||||
|
||||
clean-all:
|
||||
go clean
|
||||
rm bin/${BINARY_NAME}-darwin
|
||||
rm bin/${BINARY_NAME}-linux
|
||||
rm bin/${BINARY_NAME}-windows.exe
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
test_coverage:
|
||||
go test ./... -coverprofile=coverage.out
|
Loading…
Reference in New Issue