-
Notifications
You must be signed in to change notification settings - Fork 4
85 lines (70 loc) · 1.82 KB
/
Copy pathsemantic-release.yml
File metadata and controls
85 lines (70 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Semantic Release
on:
push:
branches:
- main
- master
workflow_dispatch:
permissions:
contents: write
issues: write
pull-requests: write
jobs:
semantic-release:
name: Semantic Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
outputs:
new-release-published: ${{ steps.semantic.outputs.new-release-published }}
new-release-version: ${{ steps.semantic.outputs.new-release-version }}
new-release-git-tag: ${{ steps.semantic.outputs.new-release-git-tag }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
- name: Install semantic-release
run: |
npm install
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.x'
- name: Run tests
run: go test -race ./...
- name: Run semantic-release
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
goreleaser:
name: GoReleaser
runs-on: ubuntu-latest
needs: semantic-release
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.x'
- name: git pull
run: git pull origin main
- name: Fetch tags
run: git fetch --tags
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}