-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 1.04 KB
/
release.yml
File metadata and controls
39 lines (31 loc) · 1.04 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
name: Build and Upload Release Artifact
on:
release:
types: [published] # triggers when a new release is published
permissions:
contents: write # required to upload assets to the release
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Build binary
run: |
mkdir -p dist
go build -ldflags="-s -w" -o dist/prometheus_gitlabci_exporter .
- name: Package binary
run: |
cd dist
tar -czf prometheus_gitlabci_exporter-${{ github.event.release.tag_name }}.tar.gz prometheus_gitlabci_exporter
ls -lh
- name: Upload artifact to release
uses: softprops/action-gh-release@v2
with:
files: dist/prometheus_gitlabci_exporter-${{ github.event.release.tag_name }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}