Skip to content

Commit

Permalink
feat: add goreleaser and workflow (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
muse-sisay authored Sep 6, 2024
1 parent e0d2592 commit b3cf4d8
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 15 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,29 @@ on:
release:
types: [created]

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
RELEASE_NOTES: "generated by a new release in konstructio/colony repo"
permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '>=1.18.0'
go-version-file: go.mod

-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CLI_VERSION: $GITHUB_REF_NAME
AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

41 changes: 41 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 2

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
flags:
- -trimpath
ldflags:
- -s -w -extldflags "-static"

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
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 }}
checksum:
name_template: "{{ .ProjectName }}_checksums.txt"
# snapshot:
# name_template: '{{ incpatch .Version }}-next'
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

brews:
- name: colony
homepage: https://github.com/konstructio/colony
repository:
owner: konstructio
name: homebrew-taps

0 comments on commit b3cf4d8

Please sign in to comment.