Attach version info to binaries
This commit is contained in:
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@@ -40,10 +40,10 @@ jobs:
|
||||
race: false
|
||||
ldflags: >
|
||||
-s -w
|
||||
-X 'version.BuiltAt=$(date +%Y-%m-%dT%H:%M:%S)'
|
||||
-X 'version.GoVersion=$(go version)'
|
||||
-X 'version.GitCommit=$(git rev-parse HEAD)'
|
||||
-X 'version.Version=${{ steps.version.outputs.version }}'
|
||||
-X 'github.com/debridmediamanager/zurg/internal.BuiltAt=$(date +%Y-%m-%dT%H:%M:%S)'
|
||||
-X 'github.com/debridmediamanager/zurg/internal.GoVersion=$(go version | cut -d ' ' -f 3)'
|
||||
-X 'github.com/debridmediamanager/zurg/internal.GitCommit=$(git rev-parse HEAD)'
|
||||
-X 'github.com/debridmediamanager/zurg/internal.Version=${{ steps.version.outputs.version }}'
|
||||
buildmode: default
|
||||
trimpath: true
|
||||
|
||||
@@ -57,7 +57,10 @@ jobs:
|
||||
platform=$(echo $platform | sed 's/.exe//g')
|
||||
extension=".exe"
|
||||
fi
|
||||
(cd artifacts && zip -r "../compressed_artifacts/zurg-${{ steps.version.outputs.version }}-$platform.zip" "zurg-$platform$extension")
|
||||
cd artifacts
|
||||
cp -f "zurg-$platform$extension" zurg
|
||||
zip -r "../compressed_artifacts/zurg-${{ steps.version.outputs.version }}-$platform.zip" zurg
|
||||
cd ..
|
||||
done
|
||||
|
||||
- name: Upload artifacts to workflow
|
||||
|
||||
@@ -11,7 +11,7 @@ FROM golang:1-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN apk add --no-cache bash git go gcc musl-dev curl fuse
|
||||
RUN go build -ldflags="-s -w -X 'main.BuiltAt=${BuiltAt}' -X 'main.GoVersion=${GoVersion}' -X 'main.GitCommit=${GitCommit}' -X 'main.Version=${Version}'" -o zurg cmd/zurg/main.go
|
||||
RUN go build -ldflags="-s -w -X 'github.com/debridmediamanager/zurg/internal.BuiltAt=${BuiltAt}' -X 'github.com/debridmediamanager/zurg/internal.GoVersion=${GoVersion}' -X 'github.com/debridmediamanager/zurg/internal.GitCommit=${GitCommit}' -X 'github.com/debridmediamanager/zurg/internal.Version=${Version}'" -o zurg cmd/zurg
|
||||
|
||||
# Obfuscation stage
|
||||
FROM alpine:3 AS obfuscator
|
||||
|
||||
Reference in New Issue
Block a user