Skip to content

Commit 91d7818

Browse files
committed
add goreleaser
1 parent c74c5ff commit 91d7818

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

.github/workflows/release.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# .github/workflows/release.yml
2+
name: goreleaser
3+
4+
on:
5+
pull_request:
6+
push:
7+
# run only against tags
8+
tags:
9+
- "*"
10+
11+
permissions:
12+
contents: write
13+
# packages: write
14+
# issues: write
15+
16+
jobs:
17+
goreleaser:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: stable
28+
# More assembly might be required: Docker logins, GPG, etc.
29+
# It all depends on your needs.
30+
- name: Run GoReleaser
31+
uses: goreleaser/goreleaser-action@v5
32+
with:
33+
# either 'goreleaser' (default) or 'goreleaser-pro'
34+
distribution: goreleaser
35+
# 'latest', 'nightly', or a semver
36+
version: "~> v1"
37+
args: release --clean
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
41+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.goreleaser.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
5+
- env:
6+
- CGO_ENABLED=0
7+
goos:
8+
- linux
9+
- windows
10+
- darwin
11+
archives:
12+
- format: tar.gz
13+
# this name template makes the OS and Arch compatible with the results of uname.
14+
name_template: >-
15+
{{ .ProjectName }}-
16+
{{ .Os }}-
17+
{{- if eq .Arch "amd64" }}x86_64
18+
{{- else if eq .Arch "386" }}i386
19+
{{- else }}{{ .Arch }}{{ end }}
20+
{{- if .Arm }}v{{ .Arm }}{{ end }}
21+
# use zip for windows archives
22+
format_overrides:
23+
- goos: windows
24+
format: zip
25+
checksum:
26+
name_template: 'checksums.txt'
27+
snapshot:
28+
name_template: "{{ incpatch .Version }}-next"
29+
changelog:
30+
sort: asc
31+
filters:
32+
exclude:
33+
- '^docs:'
34+
- '^test:'
35+
36+
# The lines beneath this are called `modelines`. See `:help modeline`
37+
# Feel free to remove those if you don't want/use them.
38+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
39+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/asim/git-http-backend
22

3-
go 1.18
3+
go 1.20

0 commit comments

Comments
 (0)