This commit is contained in:
johlanse 2022-08-21 16:17:10 +08:00
parent fb8149f3a7
commit 01981b4d96
1 changed files with 2 additions and 0 deletions

View File

@ -5,6 +5,7 @@ on: [push, pull_request]
env: env:
BINARY_PREFIX: "study_xxqg_" BINARY_PREFIX: "study_xxqg_"
BINARY_SUFFIX: "" BINARY_SUFFIX: ""
COMMIT_ID: "${{ github.sha }}"
PR_PROMPT: "::warning:: Build artifact will not be uploaded due to the workflow is trigged by pull request." PR_PROMPT: "::warning:: Build artifact will not be uploaded due to the workflow is trigged by pull request."
LD_FLAGS: "-w -s" LD_FLAGS: "-w -s"
@ -40,6 +41,7 @@ jobs:
IS_PR: ${{ !!github.head_ref }} IS_PR: ${{ !!github.head_ref }}
CGO_ENABLED: 0 CGO_ENABLED: 0
run: | run: |
echo $COMMIT_ID
if [ $GOOS = "windows" ]; then export BINARY_SUFFIX="$BINARY_SUFFIX.exe"; fi if [ $GOOS = "windows" ]; then export BINARY_SUFFIX="$BINARY_SUFFIX.exe"; fi
if $IS_PR ; then echo $PR_PROMPT; fi if $IS_PR ; then echo $PR_PROMPT; fi
export BINARY_NAME="$BINARY_PREFIX$GOOS_$GOARCH$BINARY_SUFFIX" export BINARY_NAME="$BINARY_PREFIX$GOOS_$GOARCH$BINARY_SUFFIX"