Skip to content

Commit 124d569

Browse files
Adding release on tag creation github action
1 parent 4e2ff62 commit 124d569

File tree

3 files changed

+71
-1
lines changed

3 files changed

+71
-1
lines changed

.github/workflows/main.yml renamed to .github/workflows/lint_format.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ name: Go CI
33
on:
44
push:
55
branches: [ "main" ]
6+
67
pull_request:
78
branches: [ "main" ]
89

10+
911
jobs:
1012
build:
1113
runs-on: ubuntu-latest
@@ -36,4 +38,4 @@ jobs:
3638
args: --timeout 3m
3739
- name: Go Format
3840
run: gofmt -s -w . && git diff --exit-code
39-
41+

.github/workflows/release.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
9+
jobs:
10+
goreleaser:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: "true"
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: 1.21
24+
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v6.0.0
27+
with:
28+
version: latest
29+
args: release --clean
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+

.goreleaser.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
builds:
2+
- main: ./cmd/cat
3+
id: "cat"
4+
binary: cat
5+
6+
- main: ./cmd/echo
7+
id: "echo"
8+
binary: echo
9+
10+
- main: ./cmd/env
11+
id: "env"
12+
binary: env
13+
14+
- main: ./cmd/false
15+
id: "false"
16+
binary: False_
17+
18+
- main: ./cmd/head
19+
id: "head"
20+
binary: head
21+
22+
- main: ./cmd/tail
23+
id: "tail"
24+
binary: tail
25+
26+
- main: ./cmd/tree
27+
id: "tree"
28+
binary: tree
29+
30+
- main: ./cmd/wc
31+
id: "wc"
32+
binary: wc
33+
34+
- main: ./cmd/yes
35+
id: "yes"
36+
binary: yes_

0 commit comments

Comments
 (0)