diff --git a/.github/.goreleaser.yaml b/.github/.goreleaser.yaml new file mode 100644 index 0000000..727d157 --- /dev/null +++ b/.github/.goreleaser.yaml @@ -0,0 +1,48 @@ +--- +version: 2 + +# before +before: + hooks: + - "go mod tidy" + - "go generate ./..." + +# archives +archives: + - formats: ["tar.gz"] + name_template: "{{.ProjectName}}-v{{.Version}}-{{ .Os }}-{{ .Arch }}" + format_overrides: + - goos: "windows" + formats: ["zip"] + +# build +builds: + - id: "gogitlabber" + binary: "gogitlabber" + main: "./cmd/gogitlabber" + env: + - "CGO_ENABLED=0" + goarch: + - "amd64" + - "arm64" + goos: + - "linux" + - "windows" + - "darwin" + +# 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/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3d8c59e --- /dev/null +++ b/.github/workflows/release.yml @@ -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 ./.gitlab/.goreleaser.yaml" + env: + GITHUB_TOKEN: '${{ secrets.GORELEASER_GITHUB_TOKEN }}'