From 554268a52054c1ae4dde87e05a45e90aa95334ed Mon Sep 17 00:00:00 2001 From: Leo Douglas Date: Sun, 24 Nov 2024 13:19:36 +0800 Subject: [PATCH] chore: make version apk compatible --- .github/workflows/build-alpha.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-alpha.yml b/.github/workflows/build-alpha.yml index 8749b10..f243e34 100644 --- a/.github/workflows/build-alpha.yml +++ b/.github/workflows/build-alpha.yml @@ -52,7 +52,7 @@ jobs: run: | git clone https://github.com/MetaCubeX/mihomo.git -b Alpha cd mihomo - VER=$(git log -1 --format="%cd" --date=format:'%Y%m%d%H%M%S' | sed s/-//g) + VER="$(git log -1 --format="%cd" --date=format:'%Y%m%d%H%M%S' | sed s/-//g)"~"$(git rev-parse --short HEAD)" echo "PKG_VER=$VER" >> $GITHUB_ENV echo "HEAD_REF=$(git rev-parse HEAD)" >> $GITHUB_ENV cd - @@ -108,6 +108,16 @@ jobs: tag=$(date +"%Y%m%d") echo "RELEASE_TAG=$tag" >> $GITHUB_OUTPUT + - name: Delete old release assets + uses: mknejp/delete-release-assets@v1 + continue-on-error: true + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ steps.read_release.outputs.RELEASE_TAG }} + assets: | + mihomo-[0-9]{14}\.[a-f0-9]{8}-*_${{ matrix.arch }}.apk + + - name: Publishing to GitHub Releases uses: svenstaro/upload-release-action@v2 with: @@ -115,6 +125,7 @@ jobs: file: sdk/bin/packages/*/*/mihomo*.apk tag: ${{ steps.read_release.outputs.RELEASE_TAG }} file_glob: true + asset_name: ${{ env.PKG_NAME }} overwrite: true body: | ${{ steps.read_release.outputs.RELEASE_BODY }}