Skip to content

Commit 3152c69

Browse files
committed
add release job
1 parent 1720c87 commit 3152c69

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
name: unit-tests
1+
name: tests-and-release
22

33
on:
44
pull_request:
55
workflow_dispatch:
66
push:
77
branches:
88
- main
9+
tags:
10+
- "*"
11+
12+
permissions:
13+
contents: write
914

1015
jobs:
1116
unit-test:
@@ -21,3 +26,26 @@ jobs:
2126

2227
- name: unit tests
2328
run: go test ./...
29+
30+
release:
31+
runs-on: ubuntu-latest
32+
needs: unit-test
33+
if: startsWith(github.ref, 'refs/tags/')
34+
steps:
35+
- name: checkout
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: set up go
41+
uses: actions/setup-go@v5
42+
with:
43+
go-version: "1.22"
44+
45+
- name: create release
46+
uses: goreleaser/goreleaser-action@master
47+
with:
48+
version: latest
49+
args: release --clean
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)