Release from main #23
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: Release from main | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Semver version to cut a release for (ie. 4.0.3)' | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- run: | | |
GOOS=linux go build -ldflags "-X main.version=$VERSION" -o bin/log-cache-cf-plugin-linux | |
GOOS=darwin go build -ldflags "-X main.version=$VERSION" -o bin/log-cache-cf-plugin-darwin | |
GOOS=windows go build -ldflags "-X main.version=$VERSION" -o bin/log-cache-cf-plugin-windows | |
env: | |
VERSION: ${{ github.event.inputs.version }} | |
CGO_ENABLED: 0 | |
- run: | | |
go_version=`go version | { read _ _ v _; echo ${v#go}; }` | |
gh release create -d -t "v$VERSION" --generate-notes "v$VERSION" --notes ":sparkles: built with go$go_version" ./bin/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VERSION: ${{ github.event.inputs.version }} |