mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
ci: use commit sha version
This commit is contained in:
parent
c61de34732
commit
8ba93cbf7c
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -5,8 +5,8 @@ on: [push, pull_request,workflow_dispatch]
|
||||
env:
|
||||
BINARY_PREFIX: "go-cqhttp_"
|
||||
BINARY_SUFFIX: ""
|
||||
COMMIT_ID: "${{ github.sha }}"
|
||||
PR_PROMPT: "::warning:: Build artifact will not be uploaded due to the workflow is trigged by pull request."
|
||||
LD_FLAGS: "-w -s"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -46,7 +46,7 @@ jobs:
|
||||
if $IS_PR ; then echo $PR_PROMPT; fi
|
||||
export BINARY_NAME="$BINARY_PREFIX$GOOS_$GOARCH$BINARY_SUFFIX"
|
||||
export CGO_ENABLED=0
|
||||
go build -o "output/$BINARY_NAME" -trimpath -ldflags "$LD_FLAGS" .
|
||||
go build -o "output/$BINARY_NAME" -trimpath -ldflags "-w -s -X main.version=${COMMIT_ID::7}" .
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
if: ${{ !github.head_ref }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user