From 7bf362cc6617c02ea3f255922ffac2470f3aeda9 Mon Sep 17 00:00:00 2001 From: nullcat Date: Mon, 25 May 2026 00:59:41 +0800 Subject: [PATCH] chore(ci): compress artifact with upx and update binary name --- .github/workflows/build.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb6971d..99928b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,15 +30,26 @@ jobs: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} run: | - DATE=$(date +'%y%m%d') - BINARY_NAME="tslink-dev${DATE}-${{ matrix.goos }}_${{ matrix.goarch }}" + BINARY_NAME="tslink" if [ "${{ matrix.goos }}" = "windows" ]; then BINARY_NAME="${BINARY_NAME}.exe" fi 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 uses: actions/upload-artifact@v4 with: - name: tslink-${{ matrix.goos }}-${{ matrix.goarch }} + name: tslink-dev${{ steps.date.outputs.date }}-${{ matrix.goos }}_${{ matrix.goarch }} path: release/