Skip to content

Commit

Permalink
ci(goreleaser): add release phase
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Apr 17, 2023
1 parent bdfbcf0 commit c0b63e7
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: release

on:
workflow_dispatch:
push:
tags:
- '*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 18 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ builds:
- env:
- CGO_ENABLED=0
ldflags: -s -w
hooks:
post:
- upx --best "{{ .Path }}"
goos:
- linux
- windows
Expand Down Expand Up @@ -52,8 +49,22 @@ archives:
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
use: github
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
groups:
- title: New Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: 'Documentation updates'
regexp: "^.*docs[(\\w)]*:+.*$"
order: 2
- title: 'Refactoring'
regexp: "^.*refactor[(\\w)]*:+.*$"
order: 3
- title: Others
order: 4
release:
draft: true

0 comments on commit c0b63e7

Please sign in to comment.