Skip to content

Commit

Permalink
Add github action and goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
egovelox committed Mar 23, 2024
1 parent 5a2a3ff commit 00e5b5c
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: goreleaser

on:
push:
# run only against tags
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

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

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.21.1'
cache: true
cache-dependency-path: |
cli/go.sum
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean -f ./cli/.goreleaser.yaml
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
# distribution:
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
2 changes: 2 additions & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

dist/
53 changes: 53 additions & 0 deletions cli/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
project_name: mozeidon-cli

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
flags:
- -tags=pro dev
dir: ./cli
archives:
- format: tar.gz
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 }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

release:
prerelease: auto

universal_binaries:
- replace: true
brews:
-
name: mozeidon-cli
homepage: https://github.com/egovelox
repository:
owner: egovelox
name: homebrew-mozeidon
commit_author:
name: egovelox

0 comments on commit 00e5b5c

Please sign in to comment.