Skip to content

Commit

Permalink
[chore] fix workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
peanut996 committed Jan 1, 2024
1 parent 76e6135 commit b6435e4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ jobs:
- name: Set APP_VERSION env
run: echo APP_VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV}

- name: Set ldflags as environment variable
run: |
if [ ${{ matrix.goos }} == 'linux' ]; then
LD_FLAGS="-X main.Version=${{ env.APP_VERSION }} -linkmode 'external' -extldflags '-static'"
else
LD_FLAGS="-X main.Version=${{ env.APP_VERSION }}"
fi
echo "LD_FLAGS=$LD_FLAGS" >> ${GITHUB_ENV}
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -34,4 +43,4 @@ jobs:
project_path: "."
binary_name: "CloudflareWarpSpeedTest"
goversion: "1.20"
ldflags: "-X main.Version=${{ env.APP_VERSION }} -linkmode 'external' -extldflags '-static'"
ldflags: "${{ env.LD_FLAGS }}"

0 comments on commit b6435e4

Please sign in to comment.