-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 1.85 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
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
name: Release
on:
push:
branches:
- "main"
tags:
- "v*"
pull_request:
jobs:
logcli:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.6
- name: Install package dependencies
run: |
sudo apt-get update
sudo apt-get install -y make protobuf-compiler zip
- name: Install Go dependencies
run: |
go install github.com/golang/protobuf/protoc-gen-go@v1.3.0
go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.2.1
- name: Pre-generate code
run: make BUILD_IN_CONTAINER=false generate
- name: Build logcli
run: make BUILD_IN_CONTAINER=false logcli
env:
GOARCH: ${{ matrix.arch }}
- name: Zip logcli
run: zip --junk-paths logcli_${{ matrix.arch }}.zip cmd/logcli/logcli
- name: Upload logcli as artifact
uses: actions/upload-artifact@v3
with:
name: logcli_${{ matrix.arch }}
path: logcli_${{ matrix.arch }}.zip
retention-days: 3
release:
runs-on: ubuntu-latest
needs: logcli
if: startsWith(github.event.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Create draft release
uses: ncipollo/release-action@v1
with:
artifacts: "artifacts/logcli_*/logcli_*.zip"
artifactErrorsFailBuild: true
bodyFile: ".github/release_template.md"
draft: true