Update release.yml

This commit is contained in:
Jayateertha Guruprasad 2022-05-17 22:31:48 +05:30 committed by GitHub
parent 291e3ae81f
commit 160cc6eac0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,28 +1,42 @@
name: Release Go binaries name: goreleaser
on: on:
release: push:
types: [created] # run only against tags
tags:
- '*'
permissions:
contents: write
# packages: write
# issues: write
jobs: jobs:
releases-matrix: goreleaser:
name: Release Go Binary
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/amd64
goos: [linux, darwin, windows]
goarch: [amd64, arm64, arm, 386]
steps: steps:
- uses: actions/checkout@v2 -
- name: Run tests name: Checkout
run: go test -v -p=1 -timeout=0 ./... uses: actions/checkout@v2
- uses: wangyoucao577/go-release-action@v1.16
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0
goos: ${{ matrix.goos }} -
goarch: ${{ matrix.goarch }} name: Fetch all tags
project_path: "." run: git fetch --force --tags
binary_name: "GoShod" -
ldflags: "-s -w" name: Set up Go
extra_files: LICENSE README.md uses: actions/setup-go@v2
with:
go-version: 1.18
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}