Skip to content

Commit

Permalink
ci: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephNaberhaus committed Jan 27, 2021
1 parent 425b7d1 commit 7fef990
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
release:
types: [created]

jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/386, darwin/amd64
goos: [linux, windows, darwin]
goarch: [386, amd64]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Find Go version
run: awk '$1=="go"{print $2}' go.mod | xargs -I {} echo "::set-output name=version::{}"
id: go_mod
- name: Find release tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build versions
uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: ${{ steps.go_mod.outputs.version }}
ldflags: -X "main.version=${{ env.RELEASE_VERSION }}"
extra_files: LICENSE

0 comments on commit 7fef990

Please sign in to comment.