diff --git a/.gitignore b/.gitignore index 0416c44..ec30545 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /gogitlabber +# Added by goreleaser init: +dist/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 473a888..b9a3676 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,3 +29,16 @@ build: name: "${CI_PROJECT_NAME}" paths: - "gogitlabber" + +release: + stage: "release" + needs: + - "build" + image: + name: "goreleaser/goreleaser:v2.8.2" + entrypoint: [""] + rules: + - if: "$CI_COMMIT_TAG" + script: + - export GITLAB_TOKEN="$GORELEASER_GITLAB_TOKEN" + - "goreleaser release --rm-dist --changelog=changelog.md" diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..722a9c5 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,52 @@ +--- +version: 2 + +# before +before: + hooks: + - "go mod tidy" + - "go generate ./..." + +# build +builds: + - id: "gogitlabber" + binary: "gogitlabber" + main: "./cmd/gogitlabber" + env: + - "CGO_ENABLED=0" + goarch: + - "amd64" + - "arm64" + goos: + - "linux" + - "windows" + - "darwin" + +# archives +archives: + - formats: ["tar.gz"] + 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 }} + # use zip for windows archives + format_overrides: + - goos: "windows" + formats: ["zip"] + +# 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)" diff --git a/go.sum b/go.sum index e343d70..0b1756c 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,6 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/schollz/progressbar/v3 v3.18.0 h1:uXdoHABRFmNIjUfte/Ex7WtuyVslrw2wVPQmCN62HpA= github.com/schollz/progressbar/v3 v3.18.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec= -github.com/scornet256/go-logger v0.0.0-20250306110019-822a77b239f9 h1:oHcJkJ1kyptkzoiyplglByhjk3DOt6EVllMeS/00hSI= -github.com/scornet256/go-logger v0.0.0-20250306110019-822a77b239f9/go.mod h1:GptTzXTPlyNj2mZjhRyWfmP4EDb1Ca2osDpooBy6MmI= github.com/scornet256/go-logger v0.0.0-20250306113004-0062c214ab34 h1:icrxu4GofO9DYa4Qb06OLvaLbs/eZGQJLFQz35fQ9cQ= github.com/scornet256/go-logger v0.0.0-20250306113004-0062c214ab34/go.mod h1:GptTzXTPlyNj2mZjhRyWfmP4EDb1Ca2osDpooBy6MmI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=