From 34437890db4f58226147c866629ce4c9c13993a8 Mon Sep 17 00:00:00 2001 From: lwnmengjing Date: Thu, 25 Jul 2024 10:19:17 +0800 Subject: [PATCH] :bug: fix: all in one (#133) --- .github/workflows/ci.yml | 4 ++++ .github/workflows/release.yml | 43 +++++++++++++++++++++++++++-------- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ba910c..852de07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,10 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + if: github.event_name != 'pull_request' + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx if: github.event_name != 'pull_request' uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a03cf2..7a774e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: admin public config/*.yml - - name: Archive artifact exe + - name: Archive artifact if: matrix.os == 'windows' uses: actions/upload-artifact@v4 with: @@ -64,10 +64,33 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 - - name: Add exe + - name: Get latest release version + id: get_release + run: | + LATEST_RELEASE=$(curl -s https://api.github.com/repos/mss-boot-io/mss-boot-admin-antd/releases/latest) + VERSION=$(echo $LATEST_RELEASE | jq -r '.tag_name') + echo "LATEST_RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV + + - name: Download dist-local.tar.gz run: | - mv admin-windows-amd64/admin-windows-amd64 admin-windows-amd64/admin-windows-amd64.exe - mv admin-windows-arm64/admin-windows-arm64 admin-windows-arm64/admin-windows-arm64.exe + wget https://github.com/mss-boot-io/mss-boot-admin-antd/releases/download/${{ env.LATEST_RELEASE_VERSION }}/dist-local.tar.gz + tar -zxvf dist-local.tar.gz + cp -r dist admin-linux-amd64/ + cp -r dist admin-linux-arm64/ + cp -r dist admin-darwin-amd64/ + cp -r dist admin-darwin-arm64/ + cp -r dist admin-windows-amd64/ + cp -r dist admin-windows-arm64/ + + - name: Package + run: | + zip -r admin-linux-amd64.zip admin-linux-amd64 + zip -r admin-linux-arm64.zip admin-linux-arm64 + zip -r admin-darwin-amd64.zip admin-darwin-amd64 + zip -r admin-darwin-arm64.zip admin-darwin-arm64 + zip -r admin-windows-amd64.zip admin-windows-amd64 + zip -r admin-windows-arm64.zip admin-windows-arm64 + - name: Get version id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} @@ -77,12 +100,12 @@ jobs: with: generate_release_notes: true files: | - admin-linux-amd64/admin-linux-amd64 - admin-linux-arm64/admin-linux-arm64 - admin-darwin-amd64/admin-darwin-amd64 - admin-darwin-arm64/admin-darwin-arm64 - admin-windows-amd64/admin-windows-amd64.exe - admin-windows-arm64/admin-windows-arm64.exe + admin-linux-amd64.zip + admin-linux-arm64.zip + admin-darwin-amd64.zip + admin-darwin-arm64.zip + admin-windows-amd64.zip + admin-windows-arm64.zip prerelease: false body: | ## Pull Image