feat(ci): release using goreleaser
This commit is contained in:
parent
0062c214ab
commit
b632ee9ab1
4 changed files with 93 additions and 0 deletions
19
.github/.goreleaser.yaml
vendored
Normal file
19
.github/.goreleaser.yaml
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
---
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
# changelog
|
||||||
|
changelog:
|
||||||
|
use: "git"
|
||||||
|
sort: "desc"
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- "^chore"
|
||||||
|
- "^ci"
|
||||||
|
- "^docs"
|
||||||
|
groups:
|
||||||
|
- title: "🚀 Features"
|
||||||
|
regexp: "^feat"
|
||||||
|
- title: "🐛 Bug Fixes"
|
||||||
|
regexp: "^fix"
|
||||||
|
- title: "🛠 Maintenance"
|
||||||
|
regexp: "^(chore|refactor)"
|
||||||
34
.github/workflows/release.yaml
vendored
Normal file
34
.github/workflows/release.yaml
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
name: "release"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: "release"
|
||||||
|
runs-on: "ubuntu-latest"
|
||||||
|
steps:
|
||||||
|
|
||||||
|
# checkout repo
|
||||||
|
- name: "checkout"
|
||||||
|
uses: "actions/checkout@v4"
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# setup go
|
||||||
|
- name: "set up go"
|
||||||
|
uses: "actions/setup-go@v5"
|
||||||
|
with:
|
||||||
|
go-version: "stable"
|
||||||
|
|
||||||
|
# run goreleaser
|
||||||
|
- name: "run goreleaser"
|
||||||
|
uses: "goreleaser/goreleaser-action@v5"
|
||||||
|
with:
|
||||||
|
version: "v2.8.2"
|
||||||
|
args: "release --clean --config ./.github/.goreleaser.yaml"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
||||||
|
|
@ -2,6 +2,7 @@ image: "golang:alpine"
|
||||||
stages:
|
stages:
|
||||||
- "linter"
|
- "linter"
|
||||||
- "testing"
|
- "testing"
|
||||||
|
- "releasing"
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
stage: "linter"
|
stage: "linter"
|
||||||
|
|
@ -16,3 +17,17 @@ testing:
|
||||||
image: "cr.simoncor.net/siempie/go-build:latest"
|
image: "cr.simoncor.net/siempie/go-build:latest"
|
||||||
script:
|
script:
|
||||||
- "go test *.go"
|
- "go test *.go"
|
||||||
|
|
||||||
|
releasing:
|
||||||
|
stage: "releasing"
|
||||||
|
needs:
|
||||||
|
- "testing"
|
||||||
|
image:
|
||||||
|
name: "goreleaser/goreleaser:v2.8.2"
|
||||||
|
entrypoint: [""]
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_TAG'
|
||||||
|
variables:
|
||||||
|
GITLAB_TOKEN: '$GORELEASER_GITLAB_TOKEN'
|
||||||
|
script:
|
||||||
|
- "goreleaser release --clean"
|
||||||
|
|
|
||||||
25
.goreleaser.yaml
Normal file
25
.goreleaser.yaml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
# changelog
|
||||||
|
changelog:
|
||||||
|
use: "git"
|
||||||
|
sort: "desc"
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- "^chore"
|
||||||
|
- "^ci"
|
||||||
|
- "^docs"
|
||||||
|
groups:
|
||||||
|
- title: "🚀 Features"
|
||||||
|
regexp: "^feat"
|
||||||
|
- title: "🐛 Bug Fixes"
|
||||||
|
regexp: "^fix"
|
||||||
|
- title: "🛠 Maintenance"
|
||||||
|
regexp: "^(chore|refactor)"
|
||||||
|
|
||||||
|
# gitlab
|
||||||
|
gitlab_urls:
|
||||||
|
api: "https://gitlab.simoncor.net/api/v4/"
|
||||||
|
download: "https://gitlab.simoncor.net"
|
||||||
|
use_package_registry: true
|
||||||
Loading…
Add table
Add a link
Reference in a new issue