-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (51 loc) · 1.58 KB
/
cli_bin.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
name: Create Release | DCL Operator CLI
on:
workflow_dispatch:
inputs:
version:
type: string
description: Version of the release (eg. v1.0.0-beta, v1.1.2)
required: true
release_type:
type: boolean
description: Pre-release (set to true if there are strings in versions)
default: false
env:
OPERATOR_CLI_DIR: ./dcl-operator
CLI_NAME: "dcl-operator"
CGO_ENABLED: 0
CLI_VERSION: ${{ github.event.inputs.version }}
jobs:
build-operator-cli:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
os-label:
- linux_x86_64
- apple_silicon
exclude:
- os: ubuntu-latest
os-label: apple_silicon
- os: macos-latest
os-label: linux_x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22.2"
- name: Build for Dispatch
working-directory: ${{ env.OPERATOR_CLI_DIR }}
run: go build -o ${{env.CLI_NAME}}_${{matrix.os-label}} -ldflags "-X main.VERSION=${{ env.CLI_VERSION }}" .
- name: List Output
run: ls -ltr ${{ env.OPERATOR_CLI_DIR }}
- name: GH Release
uses: softprops/action-gh-release@v2.0.5
with:
prerelease: ${{ github.event.inputs.release_type }}
tag_name: ${{ env.CLI_VERSION }}
body_path: RELEASE_NOTES.md
files: ${{ env.OPERATOR_CLI_DIR }}/${{env.CLI_NAME}}_${{matrix.os-label}}