From d5fdbeb49c5b304aa18070ae4abae1e3d0f36763 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Sat, 25 May 2024 13:19:59 +0100 Subject: [PATCH 1/5] Make allow-third-party-capes default to false (#4690) --- .../geyser/configuration/GeyserJacksonConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/configuration/GeyserJacksonConfiguration.java b/core/src/main/java/org/geysermc/geyser/configuration/GeyserJacksonConfiguration.java index a55e4af8ffc..81ac824e432 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/GeyserJacksonConfiguration.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/GeyserJacksonConfiguration.java @@ -94,7 +94,7 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration private boolean debugMode = false; @JsonProperty("allow-third-party-capes") - private boolean allowThirdPartyCapes = true; + private boolean allowThirdPartyCapes = false; @JsonProperty("show-cooldown") private String showCooldown = "title"; From 5f7a31a1d837048a147258f3caf2f750c7738fb7 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sat, 25 May 2024 20:55:05 -0400 Subject: [PATCH 2/5] Fix #4688 --- .../org/geysermc/geyser/entity/type/InteractionEntity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/InteractionEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/InteractionEntity.java index 4e7a805b4f2..06035a47c2b 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/InteractionEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/InteractionEntity.java @@ -80,7 +80,10 @@ public void setWidth(FloatEntityMetadata width) { } public void setHeight(FloatEntityMetadata height) { - setBoundingBoxHeight(height.getPrimitiveValue()); + // Bedrock does *not* like high values being placed here + // https://gist.github.com/Owen1212055/f5d59169d3a6a5c32f0c173d57eb199d recommend(s/ed) using the tactic + // https://github.com/GeyserMC/Geyser/issues/4688 + setBoundingBoxHeight(Math.min(height.getPrimitiveValue(), 64f)); } public void setResponse(BooleanEntityMetadata response) { From cb0488a271c6db3637476477902234725461aa7f Mon Sep 17 00:00:00 2001 From: Valaphee The Meerkat <32491319+valaphee@users.noreply.github.com> Date: Mon, 27 May 2024 14:08:04 +0200 Subject: [PATCH 3/5] Fix NPE in TippedArrow when it has no components (#4694) --- .../geyser/item/type/TippedArrowItem.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/item/type/TippedArrowItem.java b/core/src/main/java/org/geysermc/geyser/item/type/TippedArrowItem.java index 85291886e9b..db33bb5842d 100644 --- a/core/src/main/java/org/geysermc/geyser/item/type/TippedArrowItem.java +++ b/core/src/main/java/org/geysermc/geyser/item/type/TippedArrowItem.java @@ -41,16 +41,18 @@ public TippedArrowItem(String javaIdentifier, Builder builder) { @Override public ItemData.Builder translateToBedrock(int count, DataComponents components, ItemMapping mapping, ItemMappings mappings) { - PotionContents potionContents = components.get(DataComponentType.POTION_CONTENTS); - if (potionContents != null) { - TippedArrowPotion tippedArrowPotion = TippedArrowPotion.of(potionContents.getPotionId()); - if (tippedArrowPotion != null) { - return ItemData.builder() - .definition(mapping.getBedrockDefinition()) - .damage(tippedArrowPotion.getBedrockId()) - .count(count); + if (components != null) { + PotionContents potionContents = components.get(DataComponentType.POTION_CONTENTS); + if (potionContents != null) { + TippedArrowPotion tippedArrowPotion = TippedArrowPotion.of(potionContents.getPotionId()); + if (tippedArrowPotion != null) { + return ItemData.builder() + .definition(mapping.getBedrockDefinition()) + .damage(tippedArrowPotion.getBedrockId()) + .count(count); + } + GeyserImpl.getInstance().getLogger().debug("Unknown Java potion (tipped arrow): " + potionContents.getPotionId()); } - GeyserImpl.getInstance().getLogger().debug("Unknown Java potion (tipped arrow): " + potionContents.getPotionId()); } return super.translateToBedrock(count, components, mapping, mappings); } From 3570caae258e43b61bfc628d18f0408e3b08af78 Mon Sep 17 00:00:00 2001 From: Valaphee The Meerkat <32491319+valaphee@users.noreply.github.com> Date: Mon, 27 May 2024 16:53:42 +0200 Subject: [PATCH 4/5] Fix crafting output not updating sometimes (#4692) * Only cancel crafting grid future if slot == 0 * Add some comments --- .../inventory/JavaContainerSetSlotTranslator.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetSlotTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetSlotTranslator.java index 4372b5ea5fa..57da00b514c 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetSlotTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/inventory/JavaContainerSetSlotTranslator.java @@ -71,10 +71,6 @@ public void translate(GeyserSession session, ClientboundContainerSetSlotPacket p InventoryTranslator translator = session.getInventoryTranslator(); if (translator != null) { - if (session.getCraftingGridFuture() != null) { - session.getCraftingGridFuture().cancel(false); - } - int slot = packet.getSlot(); if (slot >= inventory.getSize()) { GeyserLogger logger = session.getGeyser().getLogger(); @@ -111,14 +107,22 @@ public void translate(GeyserSession session, ClientboundContainerSetSlotPacket p * Checks for a changed output slot in the crafting grid, and ensures Bedrock sees the recipe. */ private static void updateCraftingGrid(GeyserSession session, int slot, ItemStack item, Inventory inventory, InventoryTranslator translator) { + // Check if it's the crafting grid result slot. if (slot != 0) { return; } + + // Check if there is any crafting grid. int gridSize = translator.getGridSize(); if (gridSize == -1) { return; } + // Only process the most recent crafting grid result, and cancel the previous one. + if (session.getCraftingGridFuture() != null) { + session.getCraftingGridFuture().cancel(false); + } + if (InventoryUtils.isEmpty(item)) { return; } From cf27b88cc820034dedc9374c61e503d60c313dfe Mon Sep 17 00:00:00 2001 From: Kas-tle <26531652+Kas-tle@users.noreply.github.com> Date: Mon, 27 May 2024 10:59:36 -0700 Subject: [PATCH 5/5] Switch to centralized GitHub actions (#4693) * Switch to centralized GitHub actions * Update PR actions as well * Publish preview only if success * Webhook on success & failure --- .github/workflows/build-remote.yml | 32 ++++---- .github/workflows/build.yml | 125 +++++++++++++---------------- .github/workflows/preview.yml | 57 +++++-------- 3 files changed, 95 insertions(+), 119 deletions(-) diff --git a/.github/workflows/build-remote.yml b/.github/workflows/build-remote.yml index d49920785eb..c815b474028 100644 --- a/.github/workflows/build-remote.yml +++ b/.github/workflows/build-remote.yml @@ -22,79 +22,79 @@ jobs: run: | echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV - - name: Set up JDK 21 + - name: Setup Java # See https://github.com/actions/setup-java/commits - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: java-version: 21 distribution: temurin - name: Checkout repository and submodules # See https://github.com/actions/checkout/commits - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: repository: ${{ inputs.repository }} ref: ${{ inputs.ref }} submodules: recursive - path: geyser - name: Validate Gradle Wrapper # See https://github.com/gradle/wrapper-validation-action/commits - uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1 + uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 - - name: Build Geyser + - name: Setup Gradle # See https://github.com/gradle/actions/commits - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 with: - arguments: build - build-root-directory: geyser cache-read-only: true + - name: Build Geyser + run: ./gradlew build + - name: Archive artifacts (Geyser Fabric) # See https://github.com/actions/upload-artifact/commits - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 if: success() with: name: Geyser Fabric path: geyser/bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar if-no-files-found: error - name: Archive artifacts (Geyser NeoForge) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser NeoForge path: geyser/bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar if-no-files-found: error - name: Archive artifacts (Geyser Standalone) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser Standalone path: geyser/bootstrap/standalone/build/libs/Geyser-Standalone.jar if-no-files-found: error - name: Archive artifacts (Geyser Spigot) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser Spigot path: geyser/bootstrap/spigot/build/libs/Geyser-Spigot.jar if-no-files-found: error - name: Archive artifacts (Geyser BungeeCord) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser BungeeCord path: geyser/bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar if-no-files-found: error - name: Archive artifacts (Geyser Velocity) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser Velocity path: geyser/bootstrap/velocity/build/libs/Geyser-Velocity.jar if-no-files-found: error - name: Archive artifacts (Geyser ViaProxy) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser ViaProxy diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ec013dc2f6..f2f2a2c827a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,84 +21,86 @@ on: jobs: build: runs-on: ubuntu-latest - env: - PROJECT: 'geyser' steps: - - name: Set Build Number - env: - BUILD_JSON: ${{ vars.RELEASEACTION_PREVRELEASE }} - run: | - BUILD_NUMBER=$(echo $BUILD_JSON | jq --arg branch "${GITHUB_REF_NAME}" 'if .[$branch] == null then 1 else .[$branch] | .t | tonumber + 1 end // 1') - echo "BUILD_NUMBER=${BUILD_NUMBER:=$GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + - name: Get Release Info + id: release-info + uses: GeyserMC/actions/previous-release@master + with: + data: ${{ vars.RELEASEACTION_PREVRELEASE }} - name: Checkout repository and submodules # See https://github.com/actions/checkout/commits - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: submodules: recursive - name: Validate Gradle Wrapper - # See https://github.com/gradle/wrapper-validation-action/commits - uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1 + # See https://github.com/gradle/actions/commits + uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 # See https://github.com/actions/setup-java/commits - - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + - name: Setup Java + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: java-version: 21 distribution: temurin - - name: Build + - name: Setup Gradle # See https://github.com/gradle/actions/commits - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 with: - arguments: build gradle-home-cache-cleanup: true + + - name: Build Geyser + run: ./gradlew build + env: + BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }} - name: Archive artifacts (Geyser Fabric) # See https://github.com/actions/upload-artifact/commits - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 if: success() with: name: Geyser Fabric path: bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar if-no-files-found: error - name: Archive artifacts (Geyser NeoForge) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser NeoForge path: bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar if-no-files-found: error - name: Archive artifacts (Geyser Standalone) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser Standalone path: bootstrap/standalone/build/libs/Geyser-Standalone.jar if-no-files-found: error - name: Archive artifacts (Geyser Spigot) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser Spigot path: bootstrap/spigot/build/libs/Geyser-Spigot.jar if-no-files-found: error - name: Archive artifacts (Geyser BungeeCord) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser BungeeCord path: bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar if-no-files-found: error - name: Archive artifacts (Geyser Velocity) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser Velocity path: bootstrap/velocity/build/libs/Geyser-Velocity.jar if-no-files-found: error - name: Archive artifacts (Geyser ViaProxy) - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 if: success() with: name: Geyser ViaProxy @@ -107,17 +109,23 @@ jobs: - name: Publish to Maven Repository if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 + run: ./gradlew publish env: + BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }} ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }} ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }} - with: - arguments: publish + + - name: Get Version + if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} + id: get-version + run: | + version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2) + echo "VERSION=${version}" >> $GITHUB_OUTPUT - name: Get Release Metadata if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} - # See https://github.com/Kas-tle/base-release-action/releases/tag/main-11 - uses: Kas-tle/base-release-action@b863fa0f89bd15267a96a72efb84aec25f168d4c # main-11 + uses: GeyserMC/actions/release@master + id: metadata with: appID: ${{ secrets.RELEASE_APP_ID }} appPrivateKey: ${{ secrets.RELEASE_APP_PK }} @@ -131,61 +139,42 @@ jobs: viaproxy:bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar releaseEnabled: false saveMetadata: true - - name: Update Generated Metadata - if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} - run: | - cat metadata.json - echo - mv metadata.json metadata.json.tmp - version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2) - jq --arg project "${PROJECT}" --arg version "${version}" ' - . - | .changes |= map({"commit", "summary", "message"}) - | .downloads |= map_values({"name", "sha256"}) - | {$project, "repo", $version, "number": .build, "changes", "downloads"} - ' metadata.json.tmp > metadata.json - cat metadata.json + releaseProject: 'geyser' + releaseVersion: ${{ steps.get-version.outputs.VERSION }} - name: Publish to Downloads API if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} - shell: bash - env: - DOWNLOADS_USERNAME: ${{ vars.DOWNLOADS_USERNAME }} - DOWNLOADS_PRIVATE_KEY: ${{ secrets.DOWNLOADS_PRIVATE_KEY }} - DOWNLOADS_SERVER_IP: ${{ secrets.DOWNLOADS_SERVER_IP }} - run: | - # Save the private key to a file - echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa - chmod 600 id_ecdsa - # Create the build folder - ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP mkdir -p "~/uploads/$PROJECT/$GITHUB_RUN_NUMBER/" - # Copy over artifacts - rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" bootstrap/**/build/libs/Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$PROJECT/$GITHUB_RUN_NUMBER/ - rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" bootstrap/mod/**/build/libs/Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$PROJECT/$GITHUB_RUN_NUMBER/ - # Run the build script - rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" metadata.json $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$PROJECT/$GITHUB_RUN_NUMBER/ + uses: GeyserMC/actions/upload-release@master + with: + username: ${{ vars.DOWNLOADS_USERNAME }} + privateKey: ${{ secrets.DOWNLOADS_PRIVATE_KEY }} + host: ${{ secrets.DOWNLOADS_SERVER_IP }} + files: | + bootstrap/bungeecord/build/libs/Geyser-BungeeCord.jar + bootstrap/mod/fabric/build/libs/Geyser-Fabric.jar + bootstrap/mod/neoforge/build/libs/Geyser-NeoForge.jar + bootstrap/spigot/build/libs/Geyser-Spigot.jar + bootstrap/standalone/build/libs/Geyser-Standalone.jar + bootstrap/velocity/build/libs/Geyser-Velocity.jar + bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar - name: Publish to Modrinth (Fabric) - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} env: + BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - with: - arguments: fabric:modrinth - gradle-home-cache-cleanup: true + run: ./gradlew fabric:modrinth - name: Publish to Modrinth (NeoForge) - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} env: + BUILD_NUMBER: ${{ steps.release-info.outputs.curentRelease }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - with: - arguments: neoforge:modrinth - gradle-home-cache-cleanup: true + run: ./gradlew neoforge:modrinth - name: Notify Discord if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Geyser' }} - # See https://github.com/Tim203/actions-git-discord-webhook/commits - uses: Tim203/actions-git-discord-webhook@70f38ded3aca51635ec978ab4e1a58cd4cd0c2ff + uses: GeyserMC/actions/notify-discord@master with: - webhook_url: ${{ secrets.DISCORD_WEBHOOK }} + discordWebhook: ${{ secrets.DISCORD_WEBHOOK }} status: ${{ job.status }} + body: ${{ steps.metadata.outputs.body }} diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 1268f06743a..a90d60ef7e2 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -26,30 +26,30 @@ on: jobs: upload: runs-on: ubuntu-latest - env: - PROJECT: 'geyserpreview' steps: - name: Set Variables id: setvars run: | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then echo "BUILD=${{ github.event.inputs.build }}" >> $GITHUB_ENV - echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT echo "RUN=${{ github.event.inputs.runId }}" >> $GITHUB_OUTPUT else echo "BUILD=${{ inputs.build }}" >> $GITHUB_ENV - echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV + echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT echo "RUN=${{ github.run_id }}" >> $GITHUB_OUTPUT fi - - uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 + - name: Download Artifacts + # See https://github.com/actions/download-artifact/commits + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.6 with: run-id: ${{ steps.setvars.outputs.RUN }} github-token: ${{ secrets.GITHUB_TOKEN }} merge-multiple: true - name: Get Preview Metadata if: success() - # See https://github.com/Kas-tle/base-release-action/releases/tag/main-11 - uses: Kas-tle/base-release-action@664c39985eb9d0d393ce98e7eb8414d3d98e762a # main-11 + uses: GeyserMC/actions/release@master + id: metadata with: appID: ${{ secrets.RELEASE_APP_ID }} appPrivateKey: ${{ secrets.RELEASE_APP_PK }} @@ -64,33 +64,20 @@ jobs: releaseEnabled: false saveMetadata: true updateReleaseData: false - - name: Update Generated Metadata - if: success() - run: | - cat metadata.json - echo - mv metadata.json metadata.json.tmp - jq --arg project "${PROJECT}" --arg version "${VERSION}" --arg number "${BUILD}" ' - . - | .downloads |= map_values({"name", "sha256"}) - | {$project, "repo", $version, "number": $number | tonumber, "changes": [], "downloads"} - ' metadata.json.tmp > metadata.json - cat metadata.json + releaseProject: 'geyserpreview' + releaseVersion: ${{ steps.setvars.outputs.VERSION }} - name: Publish to Downloads API if: success() - shell: bash - env: - DOWNLOADS_USERNAME: ${{ vars.DOWNLOADS_USERNAME }} - DOWNLOADS_PRIVATE_KEY: ${{ secrets.DOWNLOADS_PRIVATE_KEY }} - DOWNLOADS_SERVER_IP: ${{ secrets.DOWNLOADS_SERVER_IP }} - run: | - # Save the private key to a file - echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa - chmod 600 id_ecdsa - # Create the build folder - ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP mkdir -p "~/uploads/$PROJECT/$BUILD/" - # Copy over artifacts - rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$PROJECT/$BUILD/ - # Run the build script - # Push the metadata - rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" metadata.json $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$PROJECT/$BUILD/ + uses: GeyserMC/actions/upload-release@master + with: + username: ${{ vars.DOWNLOADS_USERNAME }} + privateKey: ${{ secrets.DOWNLOADS_PRIVATE_KEY }} + host: ${{ secrets.DOWNLOADS_SERVER_IP }} + files: | + Geyser-BungeeCord.jar + Geyser-Fabric.jar + Geyser-NeoForge.jar + Geyser-Spigot.jar + Geyser-Standalone.jar + Geyser-Velocity.jar + Geyser-ViaProxy.jar