fix(release): inject build version into artifacts
This commit is contained in:
@@ -95,6 +95,9 @@ jobs:
|
||||
context: .
|
||||
file: ./scripts/Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
build-args: |
|
||||
VERSION=canary
|
||||
COMMIT=${{ github.sha }}
|
||||
cache-from: type=gha,scope=build-${{ matrix.platform }}
|
||||
cache-to: type=gha,mode=max,scope=build-${{ matrix.platform }}
|
||||
outputs: type=image,name=neosmemo/memos,push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
@@ -161,7 +161,7 @@ jobs:
|
||||
|
||||
go build \
|
||||
-trimpath \
|
||||
-ldflags="-s -w -X github.com/usememos/memos/internal/version.Version=${{ needs.prepare.outputs.version }} -extldflags '-static'" \
|
||||
-ldflags="-s -w -X github.com/usememos/memos/internal/version.Version=${{ needs.prepare.outputs.version }} -X github.com/usememos/memos/internal/version.Commit=${{ github.sha }} -extldflags '-static'" \
|
||||
-tags netgo,osusergo \
|
||||
-o "build/${output_name}" \
|
||||
./cmd/memos
|
||||
|
||||
Reference in New Issue
Block a user