Skip to content

Commit

Permalink
ci(goreleaser): configure GoReleaser for releasing tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Dec 12, 2022
1 parent f1101f4 commit b44563c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand Down Expand Up @@ -72,3 +75,12 @@ jobs:
platforms: ${{ steps.docker.outputs.platforms }}
push: true
tags: ${{ steps.docker.outputs.image_name }}

- name: Run GoReleaser
if: steps.branch-name.outputs.is_tag == 'true'
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
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 @@ -10,3 +10,5 @@ Thumbs.db
/gobblr
/examples/simple/migrations/simple
/sqlite.db

dist/
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ tasks:
- before: |
curl -sfL gpm.simonemms.com | bash
gpm install pre-commit
gpm install goreleaser pre-commit
init: |
go install github.com/spf13/cobra-cli@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
Expand Down
36 changes: 36 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

# modelines, 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 b44563c

Please sign in to comment.