Update release.yml

This commit is contained in:
Akizon
2025-05-03 21:20:01 +08:00
committed by GitHub
parent ab9c81cb14
commit 8a1041fda3

View File

@@ -30,12 +30,13 @@ jobs:
GOOS: ${{ matrix.goos }} GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }} GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0 CGO_ENABLED: 0
VERSION: ${{ github.event.release.tag_name }}
run: | run: |
BINARY_NAME=komari-agent-${{ matrix.goos }}-${{ matrix.goarch }} BINARY_NAME=komari-agent-${{ matrix.goos }}-${{ matrix.goarch }}
if [ "${{ matrix.goos }}" = "windows" ]; then if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME=${BINARY_NAME}.exe BINARY_NAME=${BINARY_NAME}.exe
fi fi
go build -trimpath -ldflags="-s -w" -o $BINARY_NAME go build -trimpath -ldflags="-s -w -X main.CurrentVersion=${VERSION}" -o $BINARY_NAME
- name: Upload binary to release - name: Upload binary to release
env: env:
@@ -46,4 +47,4 @@ jobs:
BINARY_NAME=${BINARY_NAME}.exe BINARY_NAME=${BINARY_NAME}.exe
fi fi
gh release upload ${{ github.event.release.tag_name }} $BINARY_NAME --repo ${{ github.repository }} gh release upload ${{ github.event.release.tag_name }} $BINARY_NAME --repo ${{ github.repository }}
shell: bash shell: bash