Update cli_release.yaml #13
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: Build and publish tracetest CLI | |
on: | |
tags: | |
- 'v*.*.*' # Only build on tags that match the 'vX.Y.Z' pattern | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Go environment | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- name: Build my CLI for Linux | |
run: go mod download && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o tracetest-linux cli/main.go | |
- name: Build my CLI for macOS | |
run: go mod download && GOOS=darwin GOARCH=amd64 go build -o tracetest-macos cli/main.go | |
- name: Build my CLI for Windows | |
run: go mod download && GOOS=windows GOARCH=amd64 go build -o tracetest-windows.exe cli/main.go | |
- name: Get release name from tag | |
id: release | |
run: echo "::set-output name=name::$(echo ${GITHUB_REF#refs/tags/})" | |
env: | |
GITHUB_REF: ${{ github.ref }} | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
cli/tracetest-linux | |
cli/tracetest-macos | |
cli/tracetest-windows.exe | |
tag_name: ${{ github.ref }} | |
name: ${{ steps.release.outputs.name }} - Linux | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |