From b82e6d2364511eee82704dc1be1604c494d246e1 Mon Sep 17 00:00:00 2001 From: zhangyuheng Date: Wed, 11 Sep 2024 16:09:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=20hangar=20=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 49 ++++++++++---------------------------- build.gradle.kts | 2 +- 2 files changed, 14 insertions(+), 37 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8d3ffc2e..7e4d34a0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,7 @@ on: jobs: build: + # 配置权限 permissions: write-all runs-on: ubuntu-latest steps: @@ -17,66 +18,42 @@ jobs: java-version: '21' distribution: 'zulu' cache: gradle - - name: "Build with Gradle" run: ./gradlew buildPlugin - - name: "Copy jar to staging" run: | - mkdir -p staging - cp build/libs/*.jar staging/ - - - name: "Set release tag" - run: echo "RELEASE_TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV - - github_release: - needs: build - runs-on: ubuntu-latest - steps: - - name: "Checkout Repository" - uses: actions/checkout@v3 - - name: "Upload to GitHub Release" - uses: marvinpinto/action-automatic-releases@latest + mkdir staging && cp build/libs/*.jar staging/ + - name: "Build & test" + run: | + TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///') + echo "done!" + - name: "GitHub Release" + uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "${{ env.RELEASE_TAG }}" + automatic_release_tag: "${{ steps.build.outputs.TAG }}" prerelease: false files: | staging/*.jar - - modrinth_release: - needs: build - runs-on: ubuntu-latest - steps: - - name: "Checkout Repository" - uses: actions/checkout@v3 - - name: "Debug tag" - run: echo "${{ env.RELEASE_TAG }}" - name: "Modrinth Release" uses: dsx137/modrinth-release-action@main env: MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} with: - name: "${{ env.RELEASE_TAG }}" + name: ${{ env.AUTOMATIC_RELEASES_TAG }} project_id: vVZc7jAV loaders: bukkit,folia,paper,purpur,spigot game_versions: 1.20.1:1.20.6,1.21,1.21.1 - version_number: "${{ env.RELEASE_TAG }}" + version_number: ${{ env.AUTOMATIC_RELEASES_TAG }} files: | staging/*.jar - changelog: "See https://github.com/ColdeZhang/Dominion/releases/tag/${{ env.RELEASE_TAG }}" + changelog: "See https://github.com/ColdeZhang/Dominion/releases/tag/${{ env.AUTOMATIC_RELEASES_TAG }}" version_type: beta featured: false updatable: false delete_old_files: false - - hangar_release: - needs: build - runs-on: ubuntu-latest - steps: - - name: "Checkout Repository" - uses: actions/checkout@v3 - name: "Hangar Release" env: HANGAR_TOKEN: ${{ secrets.HANGAR_API_TOKEN }} run: ./gradlew build publishPluginPublicationToHangar --stacktrace + continue-on-error: true diff --git a/build.gradle.kts b/build.gradle.kts index f31271ee..288fa7ba 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "cn.lunadeer" -version = "2.6.13-beta" +version = "2.6.14-beta" java { toolchain.languageVersion.set(JavaLanguageVersion.of(21))