-
Notifications
You must be signed in to change notification settings - Fork 21
86 lines (67 loc) · 2.09 KB
/
build_release_artifacts.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
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
86
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
# TODO this combination logic of branch + tag is not working.
tags:
- v*
permissions:
id-token: write
actions: write
contents: write
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: environment variables
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.2
- name: go mod tidy
run: |
dpkg-architecture -q DEB_BUILD_ARCH
(git describe --tags --always --abbrev=0 | cut -c 1-)
go mod tidy
- uses: actions/setup-ruby@v1
with:
ruby-version: '3.x'
- run: gem install fpm --no-document
- name: make exporter
run: |
echo "GIT_TAG ${{ steps.vars.outputs.tag }}"
make exporter
- name: make deb
run: |
make deb
- name: make package-linux-arm64
run: make package-linux-arm64
- name: make package-linux-amd64
run: make package-linux-amd64
- name: gzip tar files
run: |
cd pkg/target
ls -lrt *.tar
echo "GZipping tar files"
gzip aerospike-prometheus-exporter*.tar
echo "gzipped files"
ls -lrt *.gz
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: "Aerospike Prometheus Exporter"
TAG_NAME: "${{ steps.vars.outputs.tag }}"
run: |
echo "tag_name $TAG_NAME"
files=$(find pkg/target -type f -name "aerospike-prom*" -printf "$(realpath -s %p) ")
for file in $files; do
echo "uploading file === $file"
# TODO: move this to gh instead of hub
hub release edit -a $file -m "$RELEASE_NAME $TAG_NAME" "$TAG_NAME"
done