Skip to content

Commit d84da8c

Browse files
committed
feat(ci): introduce prerelease workflow
1 parent fa2bdbf commit d84da8c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/prerelease.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: prerelease
3+
4+
on:
5+
push:
6+
tags:
7+
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
8+
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
9+
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
10+
11+
permissions:
12+
contents: write
13+
14+
concurrency:
15+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
16+
cancel-in-progress: true
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-22.04
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
24+
- name: Fetch all tags
25+
run: git fetch --force --tags
26+
- name: Cleanup pre-release tags
27+
run: git tag -l | grep -E "v[0-9]+.[0-9]+.[0-9]+-(alpha|beta|rc).[0-9]+" | xargs git tag -d
28+
- name: Setup Golang
29+
uses: actions/setup-go@v4
30+
with:
31+
go-version: "^1.21.2"
32+
- name: Setup workspace
33+
run: cp go.work.dist go.work
34+
- name: Run GoReleaser for release
35+
uses: goreleaser/goreleaser-action@v5
36+
with:
37+
distribution: goreleaser
38+
version: "1.21.2"
39+
args: release --debug --clean
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
42+
GO_VERSION: "1.21.2"

0 commit comments

Comments
 (0)