Skip to content

Commit

Permalink
Merge pull request #19 from hazelops/feature/add_go_releaser
Browse files Browse the repository at this point in the history
Add GoReleaser to github workflow (TOOLS-85)
  • Loading branch information
kobrikx authored Nov 2, 2021
2 parents 47b2694 + a0a304b commit 97138b4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/build_on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,22 @@ on:
types: [created]
jobs:
Build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: go build -o ./ize ./cmd
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
fetch-depth: 0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release -f .goreleaser.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./ize
asset_name: ${{ runner.os }}
asset_content_type: application/zip
13 changes: 13 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
project_name: ize
builds:
- env: [CGO_ENABLED=0]
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
id: "ize"
dir: .
main: ./cmd

0 comments on commit 97138b4

Please sign in to comment.