Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new github workflow to build release binaries #696

Merged
merged 3 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/release-binaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Monstache release binaries

on:
release:
types: [created]
rwynn marked this conversation as resolved.
Show resolved Hide resolved

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@5fdedb94abba051217030cc86d4523cf3f02243d
with:
distribution: goreleaser
version: ~> 1.20
args: release --clean
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 @@ -25,3 +25,5 @@ _testmain.go

# Swap files
*.swp

dist/
38 changes: 38 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
before:
hooks:
- go mod download
builds:
- id: monstache
binary: monstache
env:
- CGO_ENABLED=0
rwynn marked this conversation as resolved.
Show resolved Hide resolved
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
archives:
- id: monstache-archive
name_template: |-
monstache_{{ .Tag }}_{{ .Os }}_
{{- with .Arch -}}
{{- if (eq . "amd64") -}}x86_64
{{- else -}}{{- . -}}
{{- end -}}
{{ end }}
{{- with .Arm -}}
{{- if (eq . "6") -}}hf
{{- else -}}v{{- . -}}
{{- end -}}
{{- end -}}
builds:
- monstache
format_overrides:
- goos: windows
format: zip
files: ["LICENSE"]
checksum:
name_template: "checksums.txt"
algorithm: sha256