Skip to content

Commit

Permalink
chore: update workflow.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
athul committed Oct 27, 2021
1 parent 0cc07a6 commit bd29317
Showing 1 changed file with 27 additions and 31 deletions.
58 changes: 27 additions & 31 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
name: Go Build
on:
name: Go Release
on:
push:
branches:
- master
jobs:
tags:
- "*"
workflow_dispatch:

build:
name: Build
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.16
id: go

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.16
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Build
run: |
go build -ldflags="-s -w"
ls
- uses: actions/upload-artifact@v1
with:
name: Shelby Binary
path: shelby
- name: Run Goreleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bd29317

Please sign in to comment.