-
Notifications
You must be signed in to change notification settings - Fork 39
44 lines (41 loc) · 1.38 KB
/
release.yml
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
name: Go Build
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
tag:
description: 'Tag to build'
required: true
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goos: [linux, windows, darwin]
goarch: ["386", amd64]
exclude:
- goarch: "386"
goos: darwin
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || github.event.inputs.tag }}
- name: Get date
id: date
run: echo "value=$(date +%FT%TZ)" >> "${GITHUB_OUTPUT}"
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goversion: 1.21
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
release_tag: ${{ github.event.release.tag_name || github.event.inputs.tag }}
ldflags: |
-X github.com/prometheus/common/version.Version=${{ github.event.release.tag_name || github.event.inputs.tag }}
-X github.com/prometheus/common/version.Revision=${{ github.sha }}
-X github.com/prometheus/common/version.Branch=${{ github.ref }}
-X github.com/prometheus/common/version.BuildDate=${{ steps.date.outputs.value }}
-X github.com/prometheus/common/version.BuildUser=github-actions