Skip to content

Commit

Permalink
Adding goreleaser to release binaries
Browse files Browse the repository at this point in the history
Signed-off-by: Tejas Wanjari <[email protected]>
  • Loading branch information
tjs-w committed May 31, 2022
1 parent 0b706fd commit dadf548
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 0 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: goreleaser

on:
push:
# run only against tags
tags:
- '*'

permissions:
contents: write
# packages: write
# issues: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --force --tags

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18

- name: Build stompd
# You may pin to the exact commit or the version.
# uses: goreleaser/goreleaser-action@68acf3b1adf004ac9c2f0a4259e85c5f66e99bef
uses: goreleaser/[email protected]
with:
# GoReleaser Distribution (goreleaser or goreleaser-pro)
## distribution: # optional, default is goreleaser
# GoReleaser version
## version: # optional, default is latest
# Arguments to pass to GoReleaser
args: build --rm-dist --config .goreleaser.yaml
# Working directory (below repository root)
workdir: cmd/stompd/
# Just install GoReleaser
## install-only: # optional, default is false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build stomper
# You may pin to the exact commit or the version.
# uses: goreleaser/goreleaser-action@68acf3b1adf004ac9c2f0a4259e85c5f66e99bef
uses: goreleaser/[email protected]
with:
# GoReleaser Distribution (goreleaser or goreleaser-pro)
## distribution: # optional, default is goreleaser
# GoReleaser version
## version: # optional, default is latest
# Arguments to pass to GoReleaser
args: build --rm-dist --config .goreleaser.yaml
# Working directory (below repository root)
workdir: cmd/stomper/
# Just install GoReleaser
## install-only: # optional, default is false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release stompd
# You may pin to the exact commit or the version.
# uses: goreleaser/goreleaser-action@68acf3b1adf004ac9c2f0a4259e85c5f66e99bef
uses: goreleaser/[email protected]
with:
# GoReleaser Distribution (goreleaser or goreleaser-pro)
## distribution: # optional, default is goreleaser
# GoReleaser version
## version: # optional, default is latest
# Arguments to pass to GoReleaser
args: release --rm-dist --config .goreleaser.yaml
# Working directory (below repository root)
workdir: cmd/stompd/
# Just install GoReleaser
## install-only: # optional, default is false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release stomper
# You may pin to the exact commit or the version.
# uses: goreleaser/goreleaser-action@68acf3b1adf004ac9c2f0a4259e85c5f66e99bef
uses: goreleaser/[email protected]
with:
# GoReleaser Distribution (goreleaser or goreleaser-pro)
## distribution: # optional, default is goreleaser
# GoReleaser version
## version: # optional, default is latest
# Arguments to pass to GoReleaser
args: release --rm-dist --config .goreleaser.yaml
# Working directory (below repository root)
workdir: cmd/stomper/
# Just install GoReleaser
## install-only: # optional, default is false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
# Others
*.DS_Store
.idea/

dist/
2 changes: 2 additions & 0 deletions cmd/stompd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

dist/
33 changes: 33 additions & 0 deletions cmd/stompd/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
project_name: stompd
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: "{{ .ProjectName }}_checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
2 changes: 2 additions & 0 deletions cmd/stomper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

dist/
33 changes: 33 additions & 0 deletions cmd/stomper/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
project_name: stomper
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: "{{ .ProjectName }}_checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit dadf548

Please sign in to comment.