Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #72 from sanfrancrisko/maint/main/go_env_workflows
Browse files Browse the repository at this point in the history
(MAINT) Add WORKINGDIR env var
  • Loading branch information
sanfrancrisko authored May 27, 2021
2 parents fcb916e + f8d30f4 commit 0430593
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ env:
jobs:
goreleaser:
runs-on: ubuntu-latest
env:
WORKINGDIR: ${{ github.workspace }}
steps:
-
name: Checkout pdkgo
Expand Down
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
2 changes: 2 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ param (
[string]
$Target = 'build'
)
$Env:WORKINGDIR = $PSScriptRoot

switch ($Target) {
'build' {
$arch = go env GOHOSTARCH
Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

export WORKINGDIR=$(pwd)

target=${1:-build}
if [ "$target" == "build" ]; then
arch=$(go env GOHOSTARCH)
Expand Down

0 comments on commit 0430593

Please sign in to comment.