diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 946debaf..db0f0419 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,8 @@ env: jobs: goreleaser: runs-on: ubuntu-latest + env: + WORKINGDIR: ${{ github.workspace }} steps: - name: Checkout pdkgo diff --git a/.goreleaser.yml b/.goreleaser.yml index dc4f58a5..8709f584 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -21,9 +21,9 @@ builds: - arm - arm64 asmflags: - - all=-trimpath={{.Env.GOPATH}} + - all=-trimpath={{.Env.WORKINGDIR}} gcflags: - - all=-trimpath={{.Env.GOPATH}} + - all=-trimpath={{.Env.WORKINGDIR}} ldflags: - -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.CommitDate}} mod_timestamp: '{{ .CommitTimestamp }}' diff --git a/build.ps1 b/build.ps1 index 974a4fad..3f93e044 100644 --- a/build.ps1 +++ b/build.ps1 @@ -7,6 +7,8 @@ param ( [string] $Target = 'build' ) +$Env:WORKINGDIR = $PSScriptRoot + switch ($Target) { 'build' { $arch = go env GOHOSTARCH diff --git a/build.sh b/build.sh index 10518341..0bf279ed 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/bin/bash +export WORKINGDIR=$(pwd) + target=${1:-build} if [ "$target" == "build" ]; then arch=$(go env GOHOSTARCH)