Skip to content

Commit

Permalink
Replace with Goreleaser.
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdappollonio committed Aug 31, 2021
1 parent 200963d commit 24d7a98
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/[email protected]
- name: Setup Go
uses: actions/setup-go@v1
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Test application
Expand Down
55 changes: 21 additions & 34 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,26 @@
on: release
name: Release Go Application
name: Release tgen
on:
push:
tags:
- '*'

jobs:
release-linux:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/[email protected]
- name: Compile and release for Linux amd64
uses: ngs/[email protected]
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ github.token }}
GOARCH: amd64
GOOS: linux

release-darwin:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/[email protected]
- name: Compile and release for Darwin amd64
uses: ngs/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
GOARCH: amd64
GOOS: darwin

release-windows:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/[email protected]
- name: Compile and release for Windows amd64
uses: ngs/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
GOARCH: amd64
GOOS: windows
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tgen
tests/
dist/
31 changes: 31 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm
- arm64
tags:
- netgo
flags:
- -trimpath
ldflags:
- '-s -w -extldflags "-static"'
archives:
- replacements:
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/patrickdappollonio/tgen

require github.com/spf13/cobra v1.2.1

go 1.14
go 1.16

0 comments on commit 24d7a98

Please sign in to comment.