Release from main #30
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@v5 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- run: | | |
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$VERSION" -o "bin/log-cache-cf-plugin_${VERSION}_linux_amd64" | |
GOOS=linux GOARCH=arm64 go build -ldflags "-X main.version=$VERSION" -o "bin/log-cache-cf-plugin_${VERSION}_linux_arm64" | |
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=$VERSION" -o "bin/log-cache-cf-plugin_${VERSION}_darwin_amd64" | |
GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=$VERSION" -o "bin/log-cache-cf-plugin_${VERSION}_darwin_arm64" | |
GOOS=windows GOARCH=386 go build -ldflags "-X main.version=$VERSION" -o "bin/log-cache-cf-plugin_${VERSION}_windows_386.exe" | |
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=$VERSION" -o "bin/log-cache-cf-plugin_${VERSION}_windows_amd64.exe" | |
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 }} |