-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (46 loc) · 1.66 KB
/
release.yaml
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
name: Release
on:
push:
branches:
- main
- develop
jobs:
release:
runs-on: ubuntu-latest
environment:
name: Semver
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Run Semantic Release
id: release
uses: cycjimmy/semantic-release-action@v4
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
with:
ci: false
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/git
@semantic-release/github
conventional-changelog-conventionalcommits
- name: Build go binary
if: steps.release.outputs.new_release_published == 'true'
run: |
GOOS=linux GOARCH=amd64 go build -o gluster_exporter-${{steps.release.outputs.new_release_version }}.linux-amd64 github.com/nilpntr/gluster-exporter
GOOS=linux GOARCH=arm64 go build -o gluster_exporter-${{steps.release.outputs.new_release_version }}.linux-arm64 github.com/nilpntr/gluster-exporter
- name: Upload binaries
if: steps.release.outputs.new_release_published == 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{steps.release.outputs.new_release_version }}
files: |
gluster_exporter-${{steps.release.outputs.new_release_version }}.linux-amd64
gluster_exporter-${{steps.release.outputs.new_release_version }}.linux-arm64
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}