Skip to content

Commit

Permalink
ci(release): use ldflags instead of build command
Browse files Browse the repository at this point in the history
  • Loading branch information
giusdp committed Sep 17, 2022
1 parent 46dff7c commit b0a184b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
strategy:
matrix:
# build and publish in parallel: linux/amd64, linux/arm64, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux]
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
exclude:
- goarch: arm64
Expand All @@ -51,13 +51,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "."
build_command: |
if test -z "$TAG"
then TAG="$(git describe --tags --abbrev=0 2>/dev/null || git rev-parse --short HEAD)"
fi
echo "Building $TAG"
go build -ldflags "-X main.CLIVersion=$TAG" "$@"
ldflags: "-X main.CLIVersion=${{github.ref_name}}"
project_path: "./cmd/fl"
binary_name: "fl"
extra_files: LICENSE README.md

0 comments on commit b0a184b

Please sign in to comment.