Skip to content

Commit 0073c4d

Browse files
committed
chore: add goreleaser to upload assets to gitea
Signed-off-by: Sidharth Jawale <sidharth@obmondo.com>
1 parent af04825 commit 0073c4d

4 files changed

Lines changed: 124 additions & 1 deletion

File tree

.gitea/workflows/release.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-22.04-htzhel1-ax42-a
14+
steps:
15+
- name: Checkout
16+
uses: https://gitea.obmondo.com/Obmondo/checkout@v4.3.0
17+
with:
18+
# This is required for the changelog to work correctly.
19+
fetch-depth: 0
20+
- name: Set up Go
21+
uses: https://gitea.obmondo.com/Obmondo/setup-go@v6.0.0
22+
with:
23+
go-version-file: go.mod
24+
cache-dependency-path: go.sum
25+
- name: Run GoReleaser
26+
uses: https://gitea.obmondo.com/Obmondo/goreleaser-action@v6.4.0
27+
with:
28+
version: "v2.12.7"
29+
args: release --clean -f .goreleaser-gitea.yaml
30+
env:
31+
GITEA_TOKEN: ${{ secrets.GORELEASER_TOKEN }}

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ jobs:
2323
uses: goreleaser/goreleaser-action@v6.4.0
2424
with:
2525
version: "v2.12.7"
26-
args: release --clean
26+
args: release --clean -f .goreleaser-github.yaml
2727
env:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser-gitea.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
version: 2
2+
3+
release:
4+
footer: >-
5+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
6+
7+
changelog:
8+
use: gitea
9+
sort: asc
10+
format: "[{{ .SHA }}](https://gitea.obmondo.com/EnableIT/linuxaid-cli/commit/{{ .SHA }}) {{ .Message }}{{ with .AuthorUsername }} (@{{ . }}){{ end }}"
11+
abbrev: 7
12+
filters:
13+
exclude:
14+
- init
15+
- Merge pull request
16+
- Merge remote-tracking branch
17+
- Merge branch
18+
# Group commits messages by given regex and title.
19+
groups:
20+
- title: 💫 Features
21+
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
22+
order: 0
23+
- title: 🐛 Bug fixes
24+
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
25+
order: 1
26+
- title: 🥴 Others
27+
order: 999
28+
29+
archives:
30+
- formats: [tar.gz]
31+
# This name template makes the OS and Arch compatible with the results of uname.
32+
name_template: >-
33+
{{- .ProjectName }}_
34+
{{- .Tag }}_
35+
{{- .Os }}_
36+
{{- .Arch }}
37+
{{- if .Arm }}v{{ .Arm }}{{ end -}}
38+
builds_info:
39+
group: root
40+
owner: root
41+
mode: 0755
42+
mtime: "{{ .CommitDate }}"
43+
44+
before:
45+
hooks:
46+
- go mod tidy
47+
48+
builds:
49+
- id: "linuxaid-install"
50+
main: ./cmd/linuxaid-install
51+
binary: linuxaid-install
52+
env:
53+
- CGO_ENABLED=0
54+
goos:
55+
- linux
56+
goarch:
57+
- amd64
58+
- arm64
59+
- arm
60+
goarm:
61+
- "6"
62+
- "7"
63+
flags:
64+
- -v
65+
ldflags:
66+
- -X main.Version={{ .Tag }}
67+
- -s -w
68+
69+
- id: "linuxaid-cli"
70+
main: ./cmd/linuxaid-cli
71+
binary: linuxaid-cli
72+
env:
73+
- CGO_ENABLED=0
74+
goos:
75+
- linux
76+
goarch:
77+
- amd64
78+
- arm64
79+
- arm
80+
goarm:
81+
- "6"
82+
- "7"
83+
flags:
84+
- -v
85+
ldflags:
86+
- -X main.Version={{ .Tag }}
87+
- -s -w
88+
89+
gitea_urls:
90+
api: https://gitea.obmondo.com/api/v1
91+
download: https://gitea.obmondo.com
92+
skip_tls_verify: false

0 commit comments

Comments
 (0)