Skip to content

Commit

Permalink
chore: change release action
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie committed Feb 18, 2024
1 parent a0ade44 commit c402c01
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
# .github/workflows/release.yml

name: Release

on:
push:
tags:
- 'v*'

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
test:
permissions:
checks: write
uses: ./.github/workflows/main.yml

release:
runs-on: ubuntu-latest
needs: [ test ]
steps:
- uses: actions/checkout@v4
- uses: go-semantic-release/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- run: make release
if: success()
16 changes: 16 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
before:
hooks:
- go mod tidy
builds:
- skip: true
release:
header: |
## Changelog ({{ .Date }})
Welcome to this new release! We hope you enjoy the changes we've made.
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
.DEFAULT_GOAL := build
.DEFAULT_GOAL := release

GO ?= go
GO_RUN_TOOLS ?= $(GO) run -modfile ./tools/go.mod
GO_TEST = $(GO_RUN_TOOLS) gotest.tools/gotestsum --format pkgname
GO_RELEASER ?= $(GO_RUN_TOOLS) github.com/goreleaser/goreleaser
GO_MOD ?= $(shell ${GO} list -m)

.PHONY: release
release: ## Release the project.
$(GO_RELEASER) release --clean

.PHONY: generate
generate: ## Generate code.
$(GO) generate ./...
Expand Down Expand Up @@ -34,4 +39,4 @@ clean: ## Remove previous build.

.PHONY: help
help: ## Display this help screen.
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

0 comments on commit c402c01

Please sign in to comment.