Skip to content

Commit

Permalink
golang releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzakhany committed Sep 12, 2022
1 parent aea9fca commit 18b3536
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release
on:
push:
tags: ["v*"]

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.19'
- name: get version
id: version
run: echo ::set-output name=version::$(basename ${GITHUB_REF})

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.version }}
47 changes: 47 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
project_name: dbctl

builds:
- id: dbctl
binary: dbctl
main: .

ldflags:
- -X cmd.version={{.Version}}
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64

archives:
- id: dbctl
builds: [dbctl]
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc

groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: Others
order: 999

filters:
exclude:
- '^docs:'
- '^test:'
- '^Merge pull request'

0 comments on commit 18b3536

Please sign in to comment.