chore(ci): compress artifact with upx and update binary name

This commit is contained in:
nullcat
2026-05-25 00:59:41 +08:00
parent 6d02437087
commit 7bf362cc66
+14 -3
View File
@@ -30,15 +30,26 @@ jobs:
GOOS: ${{ matrix.goos }} GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }} GOARCH: ${{ matrix.goarch }}
run: | run: |
DATE=$(date +'%y%m%d') BINARY_NAME="tslink"
BINARY_NAME="tslink-dev${DATE}-${{ 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 -v -o "release/${BINARY_NAME}" . go build -v -o "release/${BINARY_NAME}" .
- name: Compress with UPX
uses: svenstaro/upx-action@v2
with:
files: |
release/tslink*
args: "-9"
strip: true
- name: Get current date
id: date
run: echo "date=$(date +'%y%m%d')" >> $GITHUB_OUTPUT
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: tslink-${{ matrix.goos }}-${{ matrix.goarch }} name: tslink-dev${{ steps.date.outputs.date }}-${{ matrix.goos }}_${{ matrix.goarch }}
path: release/ path: release/