Skip to content

Commit

Permalink
fix: goreleaser stuff
Browse files Browse the repository at this point in the history
- [x] rebuild .goreleaser.yml from scratch to meet new version (goreleaser init)
  - copy over pieces we need from old config
  - verified good with `goreleaser check`
- [x] change goreleaser github action to fire on newly published releases, not new tags

Our new release github action will create the release and do all the templating based on conventional commits pr titles and auto-labelling.  Now goreleaser will see the newly published release and attach the new asset builds to the new release.

Signed-off-by: jmeridth <[email protected]>
  • Loading branch information
jmeridth committed Jan 4, 2025
1 parent b879ed1 commit 698289a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 38 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
name: goreleaser

---
name: "Goreleaser"
on:
workflow_dispatch:
push:
tags:
- "*"

permissions:
contents: write

release:
types: [published]
jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
## After having trouble with the PUBLISHER_TOKEN, I started down this path...
## But I never got the APP_ID to be accepted by the action
## Error: [@octokit/auth-app] appId option must be a number or numeric string
# - name: Generate token
# id: generate_token
# uses: tibdex/github-app-token@v1
# with:
# app_id: ${{ secrets.APP_ID }}
# private_key: ${{ secrets.APP_PEM }}
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand All @@ -36,7 +22,7 @@ jobs:
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf
with:
distribution: goreleaser
version: latest
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 17 additions & 16 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
hooks:
- go mod tidy

builds:
- binary: privateer
env:
- env:
- CGO_ENABLED=0
goos:
- linux
Expand All @@ -14,7 +22,7 @@ builds:

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
Expand All @@ -24,25 +32,18 @@ archives:
{{- 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"
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "^docs:"
- "^test:"

release:
prerelease: auto

universal_binaries:
- replace: true

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

0 comments on commit 698289a

Please sign in to comment.