Skip to content

Commit

Permalink
feat: configure goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
nobe4 committed May 22, 2024
1 parent f6ec97d commit d679d9a
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 16 deletions.
43 changes: 27 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
# name: release
#
# on:
# push:
# tags:
# - "v*"
#
# permissions:
# contents: write
#
# jobs:
# release:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: cli/gh-extension-precompile@v1
name: release

on:
pull_request:
push:
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

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ go.work

/config.yaml
/cache-test.json

dist/
34 changes: 34 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

before:
hooks:
- go mod tidy

builds:
- main: ./cmd/gh-not
env:
- CGO_ENABLED=0

archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}-
{{- .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

changelog:
sort: asc

release:
draft: true

0 comments on commit d679d9a

Please sign in to comment.