Skip to content

Commit

Permalink
Create github action to generate and building a releasing using gorel…
Browse files Browse the repository at this point in the history
…easer
  • Loading branch information
gustoliveira committed Jan 10, 2025
1 parent f9db356 commit 88fb0a8
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: goreleaser

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

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@v5
with:
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v1"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
att
examples/

# Added by goreleaser init:
dist/

### Go ###
# Binaries for programs and plugins
*.exe
Expand Down
36 changes: 36 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Documentation at https://goreleaser.com

version: 2

before:
hooks:
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- 386

archives:
- format: zip

name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ clean:
@rm -f main
@rm -rf coverage.out

.PHONY: build run test clean
release:
@echo "Building release with goreleaser locally..."
@goreleaser check
@goreleaser release --snapshot --clean

.PHONY: build run test covera clean release

0 comments on commit 88fb0a8

Please sign in to comment.