-
Notifications
You must be signed in to change notification settings - Fork 15
33 lines (32 loc) · 1.57 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 }}