docker build only tags #28
Workflow file for this run
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: Go | |
on: | |
push: | |
tags: | |
- '**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- name: Build | |
run: | | |
versionflags="-X 'github.com/flant/glaball/pkg/util.Version=$GITHUB_REF_NAME' -X 'github.com/flant/glaball/pkg/util.Revision=$GITHUB_SHA' -X 'github.com/flant/glaball/pkg/util.Branch=$GITHUB_REF_NAME' -X 'github.com/flant/glaball/pkg/util.BuildUser=$GITHUB_ACTOR' -X 'github.com/flant/glaball/pkg/util.BuildDate=$(date +%Y%m%d%H%M)'" | |
for GOOS in darwin linux windows; do | |
for GOARCH in amd64 arm64; do | |
export GOOS GOARCH | |
CGO_ENABLED=0 go build -v -a -tags netgo -ldflags="-extldflags '-static' -s -w $versionflags" -o build/glaball-${GOOS}-${GOARCH} *.go | |
if [[ $GOOS == "windows" ]]; then mv build/glaball-${GOOS}-${GOARCH} build/glaball-${GOOS}-${GOARCH}.exe; fi | |
done | |
done | |
cd build; sha256sum * > sha256sums.txt | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
generate_release_notes: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
build/* |