From bf72328c37c9159353c10a212e2cf852674c944c Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Sun, 20 Aug 2023 22:16:20 +0800 Subject: [PATCH 1/6] feat: Complete release actions to DBO and Modrinth --- .github/workflows/dbo_upload.yml | 69 +++++++++++++-------------- .github/workflows/modrinth_upload.yml | 41 ++++++++++++++++ .github/workflows/promote_release.yml | 48 +++++++++++++++++-- .github/workflows/release.yml | 48 +++++++++++++++++-- build.gradle | 10 +--- 5 files changed, 163 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/modrinth_upload.yml diff --git a/.github/workflows/dbo_upload.yml b/.github/workflows/dbo_upload.yml index 3cf65bd6..03374575 100644 --- a/.github/workflows/dbo_upload.yml +++ b/.github/workflows/dbo_upload.yml @@ -1,4 +1,4 @@ -name: Manually upload release to dev.bukkit.org +name: Manually upload specific release to dev.bukkit.org on: workflow_dispatch: @@ -11,6 +11,14 @@ jobs: manually_upload_dbo_release: runs-on: ubuntu-latest steps: + - name: Get release info + id: release-info + uses: cardinalby/git-get-release-action@1.2.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag: ${{ steps.release.outputs.tag_name }} + - name: Download release artifact id: release-artifact uses: dsaltares/fetch-gh-release-asset@master @@ -19,40 +27,31 @@ jobs: version: tags/${{ github.event.inputs.version }} file: multiverse-core-${{ github.event.inputs.version }}.jar - - name: Build DBO metadata - id: metadata - uses: nickofthyme/object-remap@v1 - with: - changelog: ${{ toJson(steps.release-artifact.outputs.body) }} - changelog_type: markdown - release_type: release - display_name: ${{ github.event.inputs.version }} - game_versions: '[9994, 9974, 9973, 9561, 9560, 9261, 9190, 9016, 8897, 8849, 8503, 7915, 7667, 7330, 7105]' - relations.projects: '[{"slug": "multiverse-netherportals", "type": "optionalDependency"}, {"slug": "multiverse-portals", "type": "optionalDependency"}, {"slug": "multiverse-inventories", "type": "optionalDependency"}, {"slug": "multiverse-signportals", "type": "optionalDependency"}]' + - name: Parse release type + run: | + if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then + echo "Replacing prerelease version scheme with SNAPSHOT" + echo "RELEASE_TYPE=beta" >> $GITHUB_ENV + else + echo "Using release version scheme" + echo "RELEASE_TYPE=release" >> $GITHUB_ENV + fi - name: Upload to dev.bukkit.org - uses: Multiverse/http-request-action@debug + uses: benwoo1110/dbo-upload-action@v0.1.0 with: - url: https://dev.bukkit.org/api/projects/30765/upload-file - method: POST - contentType: multipart/form-data - customHeaders: '{ "X-Api-Token": "${{ secrets.DBO_UPLOAD_API_TOKEN }}" }' - files: '{ "file": "${{ github.workspace }}/multiverse-core-${{ github.event.inputs.version }}.jar" }' - data: '{ "metadata": ${{ toJson(steps.metadata.outputs.json) }} }' - -# Bukkit Version IDs -# 9994: 1.20.1 -# 9974: 1.20 -# 9973: 1.19.4 -# 9561: 1.19.3 -# 9560: 1.19.2 -# 9261: 1.19.1 -# 9190: 1.19 -# 9016: 1.18.2 -# 8897: 1.18.1 -# 8849: 1.18 -# 8503: 1.17 -# 7915: 1.16 -# 7667: 1.15 -# 7330: 1.14 -# 7105: 1.13 + api_token: ${{ secrets.DBO_UPLOAD_API_TOKEN }} + project_id: 30765 + changelog: ${{ steps.release-artifact.outputs.body }} + changelog_type: markdown + display_name: ${{ steps.release-artifact.outputs.version }} + game_versions: 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1 + release_type: ${{ env.RELEASE_TYPE }} + project_relations: > + [ + {"slug": "multiverse-portals", "type": "optionalDependency"}, + {"slug": "multiverse-netherportals", "type": "optionalDependency"}, + {"slug": "multiverse-signportals", "type": "optionalDependency"}, + {"slug": "multiverse-inventories", "type": "optionalDependency"} + ] + file_path: ${{ github.workspace }}/subdir/multiverse-core-${{ steps.release-artifact.outputs.version }}.jar diff --git a/.github/workflows/modrinth_upload.yml b/.github/workflows/modrinth_upload.yml new file mode 100644 index 00000000..2ca430b8 --- /dev/null +++ b/.github/workflows/modrinth_upload.yml @@ -0,0 +1,41 @@ +name: Manually upload specific release to modrinth.com + +on: + workflow_dispatch: + inputs: + version: + description: 'Release to upload' + required: true + +jobs: + manually_upload_modrinth_release: + runs-on: ubuntu-latest + steps: + - name: Get release info + id: release-info + uses: cardinalby/git-get-release-action@1.2.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag: ${{ steps.release.outputs.tag_name }} + + - name: Parse release type + run: | + if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then + echo "Replacing prerelease version scheme with SNAPSHOT" + echo "RELEASE_TYPE=beta" >> $GITHUB_ENV + else + echo "Using release version scheme" + echo "RELEASE_TYPE=release" >> $GITHUB_ENV + fi + + - name: Upload to modrinth.com + uses: gradle/gradle-build-action@v2 + with: + arguments: build modrinth + env: + GITHUB_VERSION: ${{ env.VERSION }} + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + CHANGELOG: ${{ steps.release-info.outputs.body }} + VERSION_NUMBER: ${{ steps.release-info.outputs.tag_name }} + VERSION_TYPE: ${{ env.RELEASE_TYPE }} diff --git a/.github/workflows/promote_release.yml b/.github/workflows/promote_release.yml index d9ca65e4..63547184 100644 --- a/.github/workflows/promote_release.yml +++ b/.github/workflows/promote_release.yml @@ -89,20 +89,58 @@ jobs: asset_name: multiverse-core-${{ steps.release.outputs.tag_name }}.jar tag: ${{ steps.release.outputs.tag_name }} - - name: Get Changelog - id: changelog + - name: Get release info + id: release-info uses: cardinalby/git-get-release-action@1.2.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag: ${{ steps.release.outputs.tag_name }} - - name: Modrinth Upload + - name: Download release artifact + id: release-artifact + uses: dsaltares/fetch-gh-release-asset@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: tags/${{ steps.release.outputs.tag_name }} + file: multiverse-core-${{ github.event.inputs.version }}.jar + + - name: Parse release type + run: | + if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then + echo "Replacing prerelease version scheme with SNAPSHOT" + echo "RELEASE_TYPE=beta" >> $GITHUB_ENV + else + echo "Using release version scheme" + echo "RELEASE_TYPE=release" >> $GITHUB_ENV + fi + + - name: Upload to modrinth.com uses: gradle/gradle-build-action@v2 with: arguments: build modrinth env: GITHUB_VERSION: ${{ env.VERSION }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - CHANGELOG: ${{ steps.changelog.outputs.body }} - PRERELEASE: ${{ steps.changelog.outputs.prerelease }} + CHANGELOG: ${{ steps.release-artifact.outputs.body }} + VERSION_NUMBER: ${{ steps.release.outputs.tag_name }} + VERSION_TYPE: ${{ env.RELEASE_TYPE }} + + - name: Upload to dev.bukkit.org + uses: benwoo1110/dbo-upload-action@v0.1.0 + with: + api_token: ${{ secrets.DBO_UPLOAD_API_TOKEN }} + project_id: 30765 + changelog: ${{ steps.release-artifact.outputs.body }} + changelog_type: markdown + display_name: ${{ steps.release-artifact.outputs.version }} + game_versions: 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1 + release_type: ${{ env.RELEASE_TYPE }} + project_relations: > + [ + {"slug": "multiverse-portals", "type": "optionalDependency"}, + {"slug": "multiverse-netherportals", "type": "optionalDependency"}, + {"slug": "multiverse-signportals", "type": "optionalDependency"}, + {"slug": "multiverse-inventories", "type": "optionalDependency"} + ] + file_path: ${{ github.workspace }}/subdir/multiverse-core-${{ steps.release-artifact.outputs.version }}.jar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 772a8662..90e545b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,20 +63,58 @@ jobs: asset_name: multiverse-core-${{ steps.release.outputs.tag_name }}.jar tag: ${{ steps.release.outputs.tag_name }} - - name: Get Changelog - id: changelog + - name: Get release info + id: release-info uses: cardinalby/git-get-release-action@1.2.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag: ${{ steps.release.outputs.tag_name }} - - name: Modrinth Upload + - name: Download release artifact + id: release-artifact + uses: dsaltares/fetch-gh-release-asset@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: tags/${{ steps.release.outputs.tag_name }} + file: multiverse-core-${{ github.event.inputs.version }}.jar + + - name: Parse release type + run: | + if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then + echo "Replacing prerelease version scheme with SNAPSHOT" + echo "RELEASE_TYPE=beta" >> $GITHUB_ENV + else + echo "Using release version scheme" + echo "RELEASE_TYPE=release" >> $GITHUB_ENV + fi + + - name: Upload to modrinth.com uses: gradle/gradle-build-action@v2 with: arguments: build modrinth env: GITHUB_VERSION: ${{ env.VERSION }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - CHANGELOG: ${{ steps.changelog.outputs.body }} - PRERELEASE: ${{ steps.changelog.outputs.prerelease }} + CHANGELOG: ${{ steps.release-artifact.outputs.body }} + VERSION_NUMBER: ${{ steps.release.outputs.tag_name }} + VERSION_TYPE: ${{ env.RELEASE_TYPE }} + + - name: Upload to dev.bukkit.org + uses: benwoo1110/dbo-upload-action@v0.1.0 + with: + api_token: ${{ secrets.DBO_UPLOAD_API_TOKEN }} + project_id: 30765 + changelog: ${{ steps.release-artifact.outputs.body }} + changelog_type: markdown + display_name: ${{ steps.release-artifact.outputs.version }} + game_versions: 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1 + release_type: ${{ env.RELEASE_TYPE }} + project_relations: > + [ + {"slug": "multiverse-portals", "type": "optionalDependency"}, + {"slug": "multiverse-netherportals", "type": "optionalDependency"}, + {"slug": "multiverse-signportals", "type": "optionalDependency"}, + {"slug": "multiverse-inventories", "type": "optionalDependency"} + ] + file_path: ${{ github.workspace }}/subdir/multiverse-core-${{ steps.release-artifact.outputs.version }}.jar diff --git a/build.gradle b/build.gradle index 5eb98ac8..67a517d1 100644 --- a/build.gradle +++ b/build.gradle @@ -181,14 +181,8 @@ jar.enabled = false modrinth { token = System.getenv("MODRINTH_TOKEN") projectId = "multiverse-core" - versionNumber = version - - if(System.getenv("PRERELEASE")) { - versionType = "beta" - } else { - versionType = "release" - } - + versionNumber = System.getenv("VERSION_NUMBER") + versionType = System.getenv("VERSION_TYPE") uploadFile = jar gameVersions = ["1.20.1", "1.20", "1.19.4", "1.19.3", "1.19.2", "1.19.1", "1.19", "1.18.2", "1.18.1", "1.18", "1.17.1", "1.17", "1.16.5", "1.16.4", "1.16.3", "1.16.2", "1.16.1", "1.16", "1.15.2", "1.15.1", "1.15", "1.14.4", "1.14.3", "1.14.2", "1.14.1", "1.14", "1.13.2", "1.13.1", "1.13"] loaders = ["bukkit", "spigot", "paper"] From 356d67edf446585425a6aa0da638ae74b0131955 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Mon, 21 Aug 2023 23:00:00 +0800 Subject: [PATCH 2/6] feat: Use new semantic release action --- .github/workflows/release.yml | 71 +++++++++++------------------------ 1 file changed, 22 insertions(+), 49 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90e545b8..c2fad811 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1 - - name: Test & Build + - name: Build and test uses: gradle/gradle-build-action@v2 with: arguments: clean build -x assemble -x shadowJar @@ -28,88 +28,61 @@ jobs: - name: Create release id: release - uses: Multiverse/release-on-push-action@support_prerelease - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: benwoo1110/semantic-release-action@main with: - bump_version_scheme: norelease - tag_prefix: '' - release_name: "" - use_github_release_notes: true - - - name: Modify version scheme - run: | - if [[ "${{ steps.release.outputs.tag_name }}" == *"pre"* ]]; then - echo "Replacing prerelease version scheme with SNAPSHOT" - echo "VERSION=$(echo ${{ steps.release.outputs.tag_name }} | sed -E 's/-pre.*/-SNAPSHOT/')" >> $GITHUB_ENV - else - echo "Using release version scheme" - echo "VERSION=${{ steps.release.outputs.tag_name }}" >> $GITHUB_ENV - fi + github_token: ${{ secrets.GITHUB_TOKEN }} + version_bump: prlabel + release_mode: prerelease - name: Publish package + if: steps.release.outputs.release_created == 'true' uses: gradle/gradle-build-action@v2 with: arguments: publish env: - GITHUB_VERSION: ${{ env.VERSION }} + GITHUB_VERSION: ${{ steps.release.outputs.publish_version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload release artifact + if: steps.release.outputs.release_created == 'true' uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/libs/multiverse-core-${{ env.VERSION }}.jar + file: build/libs/multiverse-core-${{ steps.release.outputs.publish_version }}.jar asset_name: multiverse-core-${{ steps.release.outputs.tag_name }}.jar tag: ${{ steps.release.outputs.tag_name }} - - name: Get release info - id: release-info - uses: cardinalby/git-get-release-action@1.2.4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag: ${{ steps.release.outputs.tag_name }} - - name: Download release artifact - id: release-artifact - uses: dsaltares/fetch-gh-release-asset@master + if: steps.release.outputs.release_created == 'true' + uses: dsaltares/fetch-gh-release-asset@v1 with: token: ${{ secrets.GITHUB_TOKEN }} version: tags/${{ steps.release.outputs.tag_name }} file: multiverse-core-${{ github.event.inputs.version }}.jar - - name: Parse release type - run: | - if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then - echo "Replacing prerelease version scheme with SNAPSHOT" - echo "RELEASE_TYPE=beta" >> $GITHUB_ENV - else - echo "Using release version scheme" - echo "RELEASE_TYPE=release" >> $GITHUB_ENV - fi - - name: Upload to modrinth.com + if: steps.release.outputs.release_created == 'true' uses: gradle/gradle-build-action@v2 with: - arguments: build modrinth + arguments: build modrinth -x checkstyleMain -x checkstyleTest env: - GITHUB_VERSION: ${{ env.VERSION }} + GITHUB_VERSION: ${{ steps.release.outputs.publish_version }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - CHANGELOG: ${{ steps.release-artifact.outputs.body }} + CHANGELOG: ${{ steps.release.outputs.body }} VERSION_NUMBER: ${{ steps.release.outputs.tag_name }} - VERSION_TYPE: ${{ env.RELEASE_TYPE }} + VERSION_TYPE: ${{ steps.release.outputs.release_type }} - name: Upload to dev.bukkit.org - uses: benwoo1110/dbo-upload-action@v0.1.0 + if: steps.release.outputs.release_created == 'true' + uses: benwoo1110/dbo-upload-action@v0.2.0 with: api_token: ${{ secrets.DBO_UPLOAD_API_TOKEN }} project_id: 30765 - changelog: ${{ steps.release-artifact.outputs.body }} + changelog: ${{ steps.release.outputs.body }} changelog_type: markdown - display_name: ${{ steps.release-artifact.outputs.version }} + display_name: ${{ steps.release.outputs.tag_name }} game_versions: 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1 - release_type: ${{ env.RELEASE_TYPE }} + release_type: ${{ steps.release.outputs.release_type }} project_relations: > [ {"slug": "multiverse-portals", "type": "optionalDependency"}, @@ -117,4 +90,4 @@ jobs: {"slug": "multiverse-signportals", "type": "optionalDependency"}, {"slug": "multiverse-inventories", "type": "optionalDependency"} ] - file_path: ${{ github.workspace }}/subdir/multiverse-core-${{ steps.release-artifact.outputs.version }}.jar + file_path: ${{ github.workspace }}/multiverse-core-${{ steps.release.outputs.tag_name }}.jar From d31f7e9d87a5a8c8087d61ceac5c973e25eac6c2 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Mon, 21 Aug 2023 23:15:25 +0800 Subject: [PATCH 3/6] fix: Modrinth upload action missing steps --- .github/workflows/modrinth_upload.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/modrinth_upload.yml b/.github/workflows/modrinth_upload.yml index 2ca430b8..38f03571 100644 --- a/.github/workflows/modrinth_upload.yml +++ b/.github/workflows/modrinth_upload.yml @@ -19,16 +19,28 @@ jobs: with: tag: ${{ steps.release.outputs.tag_name }} + - name: Modify version scheme + run: | + if [[ "${{ steps.release.outputs.tag_name }}" == *"pre"* ]]; then + echo "Replacing prerelease version scheme with SNAPSHOT" + echo "VERSION=$(echo ${{ steps.release.outputs.tag_name }} | sed -E 's/-pre.*/-SNAPSHOT/')" >> $GITHUB_ENV + else + echo "Using release version scheme" + echo "VERSION=${{ steps.release.outputs.tag_name }}" >> $GITHUB_ENV + fi + - name: Parse release type run: | if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then - echo "Replacing prerelease version scheme with SNAPSHOT" echo "RELEASE_TYPE=beta" >> $GITHUB_ENV else - echo "Using release version scheme" echo "RELEASE_TYPE=release" >> $GITHUB_ENV fi + - uses: actions/checkout@v3 + with: + ref: ${{ steps.release-info.outputs.tag_name }} + - name: Upload to modrinth.com uses: gradle/gradle-build-action@v2 with: From c4a80d7b78d51f597f152083680a5d2f218afcce Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Mon, 21 Aug 2023 23:22:35 +0800 Subject: [PATCH 4/6] feat: use new semantic release action for release promote --- .github/workflows/promote_release.yml | 67 ++++++--------------------- 1 file changed, 15 insertions(+), 52 deletions(-) diff --git a/.github/workflows/promote_release.yml b/.github/workflows/promote_release.yml index 63547184..3baccf08 100644 --- a/.github/workflows/promote_release.yml +++ b/.github/workflows/promote_release.yml @@ -1,4 +1,4 @@ -name: Manually promote last prerelease to release +name: Manually promote prerelease to release on: workflow_dispatch: @@ -6,14 +6,6 @@ on: version: description: 'Version to promote' required: true - version-bump: - description: 'Version bump to apply - should usually match the version bump used for the prerelease since last release' - required: true - type: choice - options: - - 'patch' - - 'minor' - - 'major' jobs: manually_promote_release: @@ -47,31 +39,20 @@ jobs: - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1 - - name: Remove prerelease tag - run: | - echo "Removing prerelease tag from version" - echo "VERSION=$(echo ${{ steps.get-release.outputs.tag_name }} | sed -E 's/-pre.*//')" >> $GITHUB_ENV - - - name: Build + - name: Build and test uses: gradle/gradle-build-action@v2 with: - arguments: clean build -x test -x checkstyleMain -x checkstyleTest + arguments: clean build -x assemble -x shadowJar env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_VERSION: ${{ env.VERSION }} - name: Create release id: release - uses: Multiverse/release-on-push-action@skip_prs - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: benwoo1110/semantic-release-action@main with: - bump_version_scheme: ${{ github.event.inputs.version-bump }} - tag_prefix: '' - release_name: "" - use_github_release_notes: true - ref: ${{ steps.get-release.outputs.target_commitish }} - skip_prs: true + github_token: ${{ secrets.GITHUB_TOKEN }} + version_bump: promote + promote_from: ${{ github.event.inputs.version }} - name: Publish package uses: gradle/gradle-build-action@v2 @@ -79,42 +60,24 @@ jobs: arguments: publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_VERSION: ${{ env.VERSION }} + GITHUB_VERSION: ${{ steps.release.outputs.publish_version }} - name: Upload release artifact uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/libs/multiverse-core-${{ env.VERSION }}.jar + file: build/libs/multiverse-core-${{ steps.release.outputs.publish_version }}.jar asset_name: multiverse-core-${{ steps.release.outputs.tag_name }}.jar tag: ${{ steps.release.outputs.tag_name }} - - name: Get release info - id: release-info - uses: cardinalby/git-get-release-action@1.2.4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag: ${{ steps.release.outputs.tag_name }} - - name: Download release artifact id: release-artifact - uses: dsaltares/fetch-gh-release-asset@master + uses: dsaltares/fetch-gh-release-asset@v1 with: token: ${{ secrets.GITHUB_TOKEN }} version: tags/${{ steps.release.outputs.tag_name }} file: multiverse-core-${{ github.event.inputs.version }}.jar - - name: Parse release type - run: | - if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then - echo "Replacing prerelease version scheme with SNAPSHOT" - echo "RELEASE_TYPE=beta" >> $GITHUB_ENV - else - echo "Using release version scheme" - echo "RELEASE_TYPE=release" >> $GITHUB_ENV - fi - - name: Upload to modrinth.com uses: gradle/gradle-build-action@v2 with: @@ -122,18 +85,18 @@ jobs: env: GITHUB_VERSION: ${{ env.VERSION }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - CHANGELOG: ${{ steps.release-artifact.outputs.body }} + CHANGELOG: ${{ steps.release.outputs.body }} VERSION_NUMBER: ${{ steps.release.outputs.tag_name }} VERSION_TYPE: ${{ env.RELEASE_TYPE }} - name: Upload to dev.bukkit.org - uses: benwoo1110/dbo-upload-action@v0.1.0 + uses: benwoo1110/dbo-upload-action@v0.2.0 with: api_token: ${{ secrets.DBO_UPLOAD_API_TOKEN }} project_id: 30765 - changelog: ${{ steps.release-artifact.outputs.body }} + changelog: ${{ steps.release.outputs.body }} changelog_type: markdown - display_name: ${{ steps.release-artifact.outputs.version }} + display_name: ${{ steps.release.outputs.tag_name }} game_versions: 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1 release_type: ${{ env.RELEASE_TYPE }} project_relations: > @@ -143,4 +106,4 @@ jobs: {"slug": "multiverse-signportals", "type": "optionalDependency"}, {"slug": "multiverse-inventories", "type": "optionalDependency"} ] - file_path: ${{ github.workspace }}/subdir/multiverse-core-${{ steps.release-artifact.outputs.version }}.jar + file_path: ${{ github.workspace }}/subdir/multiverse-core-${{ steps.release.outputs.tag_name }}.jar From 3330bd3031cd88e473a889ddc0ca582083145c3d Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Tue, 22 Aug 2023 09:48:46 +0800 Subject: [PATCH 5/6] feat: Remove PR labeler and change "no version bump" to "no release" --- .github/labeler.yml | 2 -- .github/workflows/pr_labeler.yml | 17 ----------------- .github/workflows/require_label.yml | 2 +- 3 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 .github/labeler.yml delete mode 100644 .github/workflows/pr_labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 0de407b5..00000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,2 +0,0 @@ -prerelease: - - '*' diff --git a/.github/workflows/pr_labeler.yml b/.github/workflows/pr_labeler.yml deleted file mode 100644 index 69387def..00000000 --- a/.github/workflows/pr_labeler.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "Pull Request Labeler" - -on: - pull_request_target: - types: [opened] - branches: [main] - -jobs: - prerelease_labeler: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/require_label.yml b/.github/workflows/require_label.yml index 13922340..e4f9c293 100644 --- a/.github/workflows/require_label.yml +++ b/.github/workflows/require_label.yml @@ -15,4 +15,4 @@ jobs: with: mode: exactly count: 1 - labels: "release:major, release:minor, release:patch, no version bump" + labels: "release:major, release:minor, release:patch, no release" From 2126efe27ce1029af569f5afd2ce9040754fe09b Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:24:52 +0800 Subject: [PATCH 6/6] fix: Remove error echo message --- .github/workflows/dbo_upload.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/dbo_upload.yml b/.github/workflows/dbo_upload.yml index 03374575..8176f619 100644 --- a/.github/workflows/dbo_upload.yml +++ b/.github/workflows/dbo_upload.yml @@ -30,10 +30,8 @@ jobs: - name: Parse release type run: | if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then - echo "Replacing prerelease version scheme with SNAPSHOT" echo "RELEASE_TYPE=beta" >> $GITHUB_ENV else - echo "Using release version scheme" echo "RELEASE_TYPE=release" >> $GITHUB_ENV fi