Skip to content

Create Release | DCL Operator CLI #11

Create Release | DCL Operator CLI

Create Release | DCL Operator CLI #11

Workflow file for this run

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: .
CLI_NAME: "witnesschain-cli"
WITNESS_NAME: "witness"
CGO_ENABLED: 0
CLI_VERSION: ${{ github.event.inputs.version }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23.0"
- name: Run test
run: make test
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.23.0"
- name: Build witnesschain-cli
working-directory: ${{ env.OPERATOR_CLI_DIR }}
run: go build -o ${{env.CLI_NAME}}_${{matrix.os-label}} -ldflags "-X main.VERSION=${{ env.CLI_VERSION }}" cmd/witnesschain-cli/main.go
- name: Build witness
working-directory: ${{ env.OPERATOR_CLI_DIR }}
run: go build -o ${{env.WITNESS_NAME}}_${{matrix.os-label}} -ldflags "-X main.VERSION=${{ env.CLI_VERSION }}" cmd/witness/main.go
- 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}}
${{ env.OPERATOR_CLI_DIR }}/${{env.WITNESS_NAME}}_${{matrix.os-label}}