Skip to content

Commit 5382d34

Browse files
committed
Add github action and goreleaser
1 parent 5a2a3ff commit 5382d34

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed

.github/workflows/release.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
# run only against tags
6+
tags:
7+
- 'v[0-9]+.[0-9]+.[0-9]+'
8+
9+
permissions:
10+
contents: write
11+
# packages: write
12+
# issues: write
13+
14+
jobs:
15+
goreleaser:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
- run: git fetch --force --tags
22+
- uses: actions/setup-go@v3
23+
with:
24+
go-version: '>=1.21.1'
25+
cache: true
26+
cache-dependency-path: |
27+
cli/go.sum
28+
# More assembly might be required: Docker logins, GPG, etc. It all depends
29+
# on your needs.
30+
- uses: goreleaser/goreleaser-action@v5
31+
with:
32+
# either 'goreleaser' (default) or 'goreleaser-pro':
33+
distribution: goreleaser
34+
version: ${{ env.GITHUB_REF_NAME }}
35+
args: release --clean -f ./cli/.goreleaser.yaml
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
38+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
39+
# distribution:
40+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

cli/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
dist/

cli/.goreleaser.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
project_name: mozeidon-cli
2+
3+
builds:
4+
- env:
5+
- CGO_ENABLED=0
6+
goos:
7+
- linux
8+
- windows
9+
- darwin
10+
goarch:
11+
- amd64
12+
- arm64
13+
flags:
14+
- -tags=pro dev
15+
main: ./cli
16+
archives:
17+
- format: tar.gz
18+
name_template: >-
19+
{{ .ProjectName }}_
20+
{{- title .Os }}_
21+
{{- if eq .Arch "amd64" }}x86_64
22+
{{- else if eq .Arch "386" }}i386
23+
{{- else }}{{ .Arch }}{{ end }}
24+
{{- if .Arm }}v{{ .Arm }}{{ end }}
25+
# use zip for windows archives
26+
format_overrides:
27+
- goos: windows
28+
format: zip
29+
checksum:
30+
name_template: 'checksums.txt'
31+
snapshot:
32+
name_template: "{{ incpatch .Version }}-next"
33+
changelog:
34+
sort: asc
35+
filters:
36+
exclude:
37+
- '^docs:'
38+
- '^test:'
39+
40+
release:
41+
prerelease: auto
42+
43+
universal_binaries:
44+
- replace: true
45+
brews:
46+
-
47+
name: mozeidon-cli
48+
homepage: https://github.com/egovelox
49+
repository:
50+
owner: egovelox
51+
name: homebrew-mozeidon
52+
commit_author:
53+
name: egovelox

0 commit comments

Comments
 (0)