From f0a16b0cd965527dd288dcd301e213f6bbfadc5c Mon Sep 17 00:00:00 2001 From: neveler <55753029+neveler@users.noreply.github.com> Date: Sat, 8 Nov 2025 21:20:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9F=A9=E9=98=B5=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E6=9B=B4=E6=96=B0=E5=B7=A5=E4=BD=9C=E6=B5=81=20(#4725?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check-update.yml | 78 ++++++++---------------------- 1 file changed, 19 insertions(+), 59 deletions(-) diff --git a/.github/workflows/check-update.yml b/.github/workflows/check-update.yml index 9d0c23162..45cc1b783 100644 --- a/.github/workflows/check-update.yml +++ b/.github/workflows/check-update.yml @@ -9,9 +9,19 @@ permissions: contents: write jobs: - dev-check-update: + check-update: if: ${{ github.repository_owner == 'HMCL-dev' }} + strategy: + fail-fast: false + max-parallel: 1 + matrix: + include: + - channel: dev + task: checkUpdateDev + - channel: stable + task: checkUpdateStable runs-on: ubuntu-latest + name: check-update-${{ matrix.channel }} steps: - uses: actions/checkout@v5 - name: Set up JDK @@ -22,7 +32,7 @@ jobs: - name: Fetch tags run: git fetch --all --tags - name: Fetch last version - run: ./gradlew checkUpdateDev --no-daemon --info --stacktrace + run: ./gradlew ${{ matrix.task }} --no-daemon --info --stacktrace - name: Check for existing tags run: if [ -z "$(git tag -l "$HMCL_TAG_NAME")" ]; then echo "continue=true" >> $GITHUB_ENV; fi - name: Download artifacts @@ -34,66 +44,16 @@ jobs: wget "$HMCL_CI_DOWNLOAD_BASE_URI/HMCL-$HMCL_VERSION.jar.sha256" wget "$HMCL_CI_DOWNLOAD_BASE_URI/HMCL-$HMCL_VERSION.sh" wget "$HMCL_CI_DOWNLOAD_BASE_URI/HMCL-$HMCL_VERSION.sh.sha256" + env: + GH_DOWNLOAD_BASE_URL: https://github.com/HMCL-dev/HMCL/releases/download - name: Generate release note if: ${{ env.continue == 'true' }} run: | - echo "The full changelogs can be found on the website: https://docs.hmcl.net/changelog/dev.html" >> RELEASE_NOTE - echo "" >> RELEASE_NOTE - echo "*Notice: changelogs are written in Chinese.*" >> RELEASE_NOTE - echo "" >> RELEASE_NOTE - echo "| File Name | SHA-256 Checksum |" >> RELEASE_NOTE - echo "| --- | --- |" >> RELEASE_NOTE - echo "| [HMCL-$HMCL_VERSION.exe]($GH_DOWNLOAD_BASE_URL/v$HMCL_VERSION/HMCL-$HMCL_VERSION.exe) | \`$(cat HMCL-$HMCL_VERSION.exe.sha256)\` |" >> RELEASE_NOTE - echo "| [HMCL-$HMCL_VERSION.jar]($GH_DOWNLOAD_BASE_URL/v$HMCL_VERSION/HMCL-$HMCL_VERSION.jar) | \`$(cat HMCL-$HMCL_VERSION.jar.sha256)\` |" >> RELEASE_NOTE - echo "| [HMCL-$HMCL_VERSION.sh]($GH_DOWNLOAD_BASE_URL/v$HMCL_VERSION/HMCL-$HMCL_VERSION.sh) | \`$(cat HMCL-$HMCL_VERSION.sh.sha256)\` |" >> RELEASE_NOTE - env: - GH_DOWNLOAD_BASE_URL: https://github.com/HMCL-dev/HMCL/releases/download - - name: Create release - if: ${{ env.continue == 'true' }} - uses: softprops/action-gh-release@v2 - with: - body_path: RELEASE_NOTE - files: | - HMCL-${{ env.HMCL_VERSION }}.exe - HMCL-${{ env.HMCL_VERSION }}.jar - HMCL-${{ env.HMCL_VERSION }}.sh - target_commitish: ${{ env.HMCL_COMMIT_SHA }} - name: ${{ env.HMCL_TAG_NAME }} - tag_name: ${{ env.HMCL_TAG_NAME }} - prerelease: true - stable-check-update: - if: ${{ github.repository_owner == 'HMCL-dev' }} - needs: dev-check-update - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - name: Set up JDK - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: '25' - - name: Fetch tags - run: git fetch --all --tags - - - name: Fetch last version - run: ./gradlew checkUpdateStable --no-daemon --info --stacktrace - - name: Check for existing tags - run: if ! git tag -l | grep -q "$HMCL_TAG_NAME"; then echo "continue=true" >> $GITHUB_ENV; fi - - name: Download artifacts - if: ${{ env.continue == 'true' }} - run: | - wget "$HMCL_CI_DOWNLOAD_BASE_URI/HMCL-$HMCL_VERSION.exe" - wget "$HMCL_CI_DOWNLOAD_BASE_URI/HMCL-$HMCL_VERSION.exe.sha256" - wget "$HMCL_CI_DOWNLOAD_BASE_URI/HMCL-$HMCL_VERSION.jar" - wget "$HMCL_CI_DOWNLOAD_BASE_URI/HMCL-$HMCL_VERSION.jar.sha256" - wget "$HMCL_CI_DOWNLOAD_BASE_URI/HMCL-$HMCL_VERSION.sh" - wget "$HMCL_CI_DOWNLOAD_BASE_URI/HMCL-$HMCL_VERSION.sh.sha256" - - name: Generate release note - if: ${{ env.continue == 'true' }} - run: | - echo "**This version is a stable version.**" >> RELEASE_NOTE - echo "" >> RELEASE_NOTE - echo "The full changelogs can be found on the website: https://docs.hmcl.net/changelog/stable.html" >> RELEASE_NOTE + if [ "${{ matrix.channel }}" = "stable" ]; then + echo "**This version is a stable version.**" >> RELEASE_NOTE + echo "" >> RELEASE_NOTE + fi + echo "The full changelogs can be found on the website: https://docs.hmcl.net/changelog/${{ matrix.channel }}.html" >> RELEASE_NOTE echo "" >> RELEASE_NOTE echo "*Notice: changelogs are written in Chinese.*" >> RELEASE_NOTE echo "" >> RELEASE_NOTE