Skip to content

Commit

Permalink
[ci] setting up goreleaser config
Browse files Browse the repository at this point in the history
  • Loading branch information
DavyLandman committed Apr 19, 2024
1 parent ac1cb9b commit 68126dc
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ jobs:
version: latest
only-new-issues: true # on PR only show new issues
skip-cache: true # avoid influencing caching that also hurts the build job


29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: goreleaser

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@
go.work

*.toml
secret-key
secret-key
dist/

go-releaser.sh
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

version: 1

before:
hooks:
- go mod tidy

builds:
- main: './cmd/backup'
env:
- CGO_ENABLED=0
goos:
- linux
- darwin

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 }}
changelog:
sort: asc
filters:
exclude:
- "^[ci]"
- "^[test]"
- "^[chore]"

0 comments on commit 68126dc

Please sign in to comment.