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

Goreleaser configuration #17

Merged
merged 5 commits into from
Aug 4, 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
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: goreleaser

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

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Fetch all tags
run: git fetch --force --tags
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

59 changes: 59 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Goignore Build Configuration

builds:
- binary: goignore
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
flags:
- -mod=vendor
#ldflags:
#- -s -w -X goignore/cmd/utils.CLI_VERSION={{.Version}}

release:
prerelease: auto

universal_binaries:
- replace: true

archives:
- id: foo
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}


checksum:
name_template: "checksums.txt"

brews:
- name: goignore
homepage: https://github.com/hacktivist123/goignore
tap:
owner: hacktivist123
name: homebrew-goignore
commit_author:
name: hacktivist123
email: [email protected]

scoop:
url_template: "https://github.com/hacktivist123/goignore/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
bucket:
owner: hacktivist123
name: scoop-goignore
folder: scoops
commit_author:
name: hacktivist123
email: [email protected]
#commit_msg_template: "Update goignore to version {{ .Tag }}"
homepage: "https://github.com/hacktivist123/goignore"
description: "A lightweight CLI tool for generating .gitignore file in your project."