Create Release | DCL Operator CLI #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |