File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 5959 env :
6060 VERSION : ${{ steps.determine_version.outputs.version }}
6161 GIT_COMMIT : ${{ steps.get_git_commit.outputs.short_sha }}
62- BUILD_TIME : ${{ github.event.repository.updated_at }}
63- run : make build
62+ GOOS : linux
63+ GOARCH : amd64
64+ CGO_ENABLED : 0
65+ run : |
66+ ldflags="-w -s -X 'main.Version=${VERSION}' -X 'main.GitCommit=${GIT_COMMIT}' -X 'main.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
67+
68+ if [[ "${{ github.ref }}" == refs/tags/* ]]; then
69+ OUTPUT_NAME="${APP_NAME}_${GOOS}_${GOARCH}"
70+ else
71+ OUTPUT_NAME="${APP_NAME}"
72+ fi
73+
74+ mkdir -p build
75+ go build -trimpath -ldflags="${ldflags}" -o build/${OUTPUT_NAME} ./cmd/controller
6476
6577 - name : Upload Artifact
6678 if : ${{ !startsWith(github.ref, 'refs/tags/') }}
@@ -109,4 +121,4 @@ jobs:
109121 draft : false
110122 body_path : release_notes.md
111123 prerelease : false
112- files : build/${{ env.APP_NAME }}
124+ files : build/${{ env.APP_NAME }}_linux_amd64
You can’t perform that action at this time.
0 commit comments