From 4236de7cfc25e2bd9310ba5666c876839b0abbf7 Mon Sep 17 00:00:00 2001 From: Shanwer Date: Tue, 26 Dec 2023 18:18:56 +0800 Subject: [PATCH] Add maunal run to check scheduled workflow --- .github/workflows/{gradle.yml => build.yml} | 5 +- .github/workflows/pullrequest.yml | 89 ----------- ...ply_patches.yml => sync_with_upstream.yml} | 7 +- .../geyser/network/UpstreamPacketHandler.java | 2 +- patches/0003-Create-gradle.yml.patch | 53 ------- ...4-Delete-.github-workflows-build.yml.patch | 148 ------------------ ...Make-workflow-artifacts-downloadable.patch | 60 ------- .../0006-change-to-the-default-branch.patch | 57 ------- patches/0007-repo.patch | 25 --- 9 files changed, 6 insertions(+), 440 deletions(-) rename .github/workflows/{gradle.yml => build.yml} (97%) delete mode 100644 .github/workflows/pullrequest.yml rename .github/workflows/{sync_and_apply_patches.yml => sync_with_upstream.yml} (87%) delete mode 100644 patches/0003-Create-gradle.yml.patch delete mode 100644 patches/0004-Delete-.github-workflows-build.yml.patch delete mode 100644 patches/0005-Make-workflow-artifacts-downloadable.patch delete mode 100644 patches/0006-change-to-the-default-branch.patch delete mode 100644 patches/0007-repo.patch diff --git a/.github/workflows/gradle.yml b/.github/workflows/build.yml similarity index 97% rename from .github/workflows/gradle.yml rename to .github/workflows/build.yml index 67936615eb2..4a917322525 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle -name: Java CI with Gradle +name: Build on: push: @@ -23,11 +23,14 @@ jobs: steps: - uses: actions/checkout@v3 + with: + submodules: recursive - name: Set up JDK 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' + - name: Build with Gradle uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 with: diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml deleted file mode 100644 index 797d6876729..00000000000 --- a/.github/workflows/pullrequest.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Build Pull Request - -on: - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Set up JDK 17 - # See https://github.com/actions/setup-java/commits - uses: actions/setup-java@4075bfc1b51bf22876335ae1cd589602d60d8758 - with: - java-version: 17 - distribution: temurin - - - name: Check if the author has forked the API repo - # See https://github.com/Kas-tle/find-forks-action/commits - uses: Kas-tle/find-forks-action@1b5447d1e3c7a8ed79583dd817cc5399686eed3a - id: find_forks - with: - owner: GeyserMC - repo: api - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Use author's API repo if it exists - if: ${{ steps.find_forks.outputs.target_branch_found == 'true' }} - env: - API_FORK_URL: ${{ steps.find_forks.outputs.user_fork_url }} - API_FORK_BRANCH: ${{ github.event.pull_request.head.ref }} - run: | - git clone "${API_FORK_URL}" --single-branch --branch "${API_FORK_BRANCH}" api - cd api - ./gradlew publishToMavenLocal - - - name: Checkout repository and submodules - # See https://github.com/actions/checkout/commits - uses: actions/checkout@72f2cec99f417b1a1c5e2e88945068983b7965f9 - with: - submodules: recursive - path: geyser - - - name: Validate Gradle Wrapper - # See https://github.com/gradle/wrapper-validation-action/commits - uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 - - - name: Build Geyser - # See https://github.com/gradle/gradle-build-action/commits - uses: gradle/gradle-build-action@3bfe3a46584a206fb8361cdedd0647b0c4204232 - with: - arguments: build - build-root-directory: geyser - - - name: Archive artifacts (Geyser Fabric) - # See https://github.com/actions/upload-artifact/commits - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - if: success() - with: - name: Geyser Fabric - path: geyser/bootstrap/fabric/build/libs/Geyser-Fabric.jar - if-no-files-found: error - - name: Archive artifacts (Geyser Standalone) - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - if: success() - with: - name: Geyser Velocity - path: geyser/bootstrap/velocity/build/libs/Geyser-Velocity.jar - if-no-files-found: error diff --git a/.github/workflows/sync_and_apply_patches.yml b/.github/workflows/sync_with_upstream.yml similarity index 87% rename from .github/workflows/sync_and_apply_patches.yml rename to .github/workflows/sync_with_upstream.yml index 94613b7cd0f..8f9cb29d0f1 100644 --- a/.github/workflows/sync_and_apply_patches.yml +++ b/.github/workflows/sync_with_upstream.yml @@ -3,6 +3,7 @@ name: Sync with Upstream on: schedule: - cron: '0 0 * * *' + workflow_dispatch: jobs: sync: @@ -32,12 +33,6 @@ jobs: exit 1 } - - name: Apply patches - run: | - for patch in Geyser/patches/*.patch; do - git apply "$patch" - done - - name: Push changes uses: ad-m/github-push-action@master with: diff --git a/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java b/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java index f3d408bd285..0292f464a70 100644 --- a/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java +++ b/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java @@ -207,7 +207,7 @@ public PacketSignal handle(ResourcePackClientResponsePacket packet) { session.authenticate(session.getAuthData().name()); } else if (!couldLoginUserByName(session.getAuthData().name())) { // We must spawn the white world - session.connect();//TODO:locate by here + session.connect();//Let bedrock user to login with online mode on } geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.network.connect", session.getAuthData().name())); break; diff --git a/patches/0003-Create-gradle.yml.patch b/patches/0003-Create-gradle.yml.patch deleted file mode 100644 index bffd5eb4d21..00000000000 --- a/patches/0003-Create-gradle.yml.patch +++ /dev/null @@ -1,53 +0,0 @@ -From e8caf2a787a9fa8d9cf27b4cef247993f4e52cb2 Mon Sep 17 00:00:00 2001 -From: Shanwer -Date: Mon, 25 Dec 2023 14:13:08 +0800 -Subject: [PATCH 3/7] Create gradle.yml - ---- - .github/workflows/gradle.yml | 34 ++++++++++++++++++++++++++++++++++ - 1 file changed, 34 insertions(+) - create mode 100644 .github/workflows/gradle.yml - -diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml -new file mode 100644 -index 00000000..d5a9d3a7 ---- /dev/null -+++ b/.github/workflows/gradle.yml -@@ -0,0 +1,34 @@ -+# This workflow uses actions that are not certified by GitHub. -+# They are provided by a third-party and are governed by -+# separate terms of service, privacy policy, and support -+# documentation. -+# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle -+ -+name: Java CI with Gradle -+ -+on: -+ push: -+ branches: [ "master" ] -+ pull_request: -+ branches: [ "master" ] -+ -+permissions: -+ contents: read -+ -+jobs: -+ build: -+ -+ runs-on: ubuntu-latest -+ -+ steps: -+ - uses: actions/checkout@v3 -+ - name: Set up JDK 17 -+ uses: actions/setup-java@v3 -+ with: -+ java-version: '17' -+ distribution: 'temurin' -+ - name: Build with Gradle -+ uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 -+ with: -+ arguments: build --- -2.39.1.windows.1 - diff --git a/patches/0004-Delete-.github-workflows-build.yml.patch b/patches/0004-Delete-.github-workflows-build.yml.patch deleted file mode 100644 index f604fa79b55..00000000000 --- a/patches/0004-Delete-.github-workflows-build.yml.patch +++ /dev/null @@ -1,148 +0,0 @@ -From 244afb6d0b103edfe0c5fa9038ff844c3e6c339b Mon Sep 17 00:00:00 2001 -From: Shanwer -Date: Mon, 25 Dec 2023 14:20:13 +0800 -Subject: [PATCH 4/7] Delete .github/workflows/build.yml - ---- - .github/workflows/build.yml | 129 ------------------------------------ - 1 file changed, 129 deletions(-) - delete mode 100644 .github/workflows/build.yml - -diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml -deleted file mode 100644 -index 6c5c1524..00000000 ---- a/.github/workflows/build.yml -+++ /dev/null -@@ -1,129 +0,0 @@ --name: Build -- --on: -- workflow_dispatch: -- push: -- paths-ignore: -- - '.github/ISSUE_TEMPLATE/*.yml' -- - '.github/actions/pullrequest.yml' -- - '.idea/copyright/*.xml' -- - '.gitignore' -- - 'CONTRIBUTING.md' -- - 'LICENSE' -- - 'Jenkinsfile ' -- - 'README.md' -- - 'licenseheader.txt' -- --jobs: -- build: -- runs-on: ubuntu-latest -- steps: -- - name: Checkout repository and submodules -- # See https://github.com/actions/checkout/commits -- uses: actions/checkout@72f2cec99f417b1a1c5e2e88945068983b7965f9 -- with: -- submodules: recursive -- -- - name: Validate Gradle Wrapper -- # See https://github.com/gradle/wrapper-validation-action/commits -- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 -- -- # See https://github.com/actions/setup-java/commits -- - uses: actions/setup-java@4075bfc1b51bf22876335ae1cd589602d60d8758 -- with: -- java-version: 17 -- distribution: temurin -- -- - name: Build -- # See https://github.com/gradle/gradle-build-action/commits -- uses: gradle/gradle-build-action@3bfe3a46584a206fb8361cdedd0647b0c4204232 -- with: -- arguments: build -- gradle-home-cache-cleanup: true -- -- - name: Archive artifacts (Geyser Fabric) -- # See https://github.com/actions/upload-artifact/commits -- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 -- if: success() -- with: -- name: Geyser Fabric -- path: bootstrap/fabric/build/libs/Geyser-Fabric.jar -- if-no-files-found: error -- - name: Archive artifacts (Geyser Standalone) -- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 -- 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 -- 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 -- 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 -- if: success() -- with: -- name: Geyser Velocity -- path: bootstrap/velocity/build/libs/Geyser-Velocity.jar -- if-no-files-found: error -- -- - name: Publish to Maven Repository -- if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} -- uses: gradle/gradle-build-action@3bfe3a46584a206fb8361cdedd0647b0c4204232 -- env: -- ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }} -- ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }} -- with: -- arguments: publish -- -- - 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 -- # Set the project -- project=geyser -- # Get the version from gradle.properties -- version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2) -- # 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/ -- # Run the build script -- # Push the metadata -- echo "{\"project\": \"$project\", \"version\": \"$version\", \"id\": $GITHUB_RUN_NUMBER, \"commit\": \"$GITHUB_SHA\"}" > metadata.json -- rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" metadata.json $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/ -- -- - name: Publish to Modrinth -- uses: gradle/gradle-build-action@3bfe3a46584a206fb8361cdedd0647b0c4204232 -- if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} -- env: -- MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} -- with: -- arguments: fabric:modrinth -- gradle-home-cache-cleanup: true -- -- - 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 -- with: -- webhook_url: ${{ secrets.DISCORD_WEBHOOK }} -- status: ${{ job.status }} --- -2.39.1.windows.1 - diff --git a/patches/0005-Make-workflow-artifacts-downloadable.patch b/patches/0005-Make-workflow-artifacts-downloadable.patch deleted file mode 100644 index b5747dadb13..00000000000 --- a/patches/0005-Make-workflow-artifacts-downloadable.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 2d2ce1d7b4f62fcbdc95b24397ab612a91491afe Mon Sep 17 00:00:00 2001 -From: Shanwer -Date: Mon, 25 Dec 2023 14:35:58 +0800 -Subject: [PATCH 5/7] Make workflow artifacts downloadable - ---- - .github/workflows/gradle.yml | 38 +++++++++++++++++++++++++++++++++++- - 1 file changed, 37 insertions(+), 1 deletion(-) - -diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml -index d5a9d3a7..5859f10f 100644 ---- a/.github/workflows/gradle.yml -+++ b/.github/workflows/gradle.yml -@@ -29,6 +29,42 @@ jobs: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle -- uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 -+ uses: gradle/gradle-build-action@v3 # v2.6.0 - with: - arguments: build -+ - name: Archive artifacts (Geyser Fabric) -+ # See https://github.com/actions/upload-artifact/commits -+ uses: actions/upload-artifact@v3 -+ if: success() -+ with: -+ name: Geyser Fabric -+ path: bootstrap/fabric/build/libs/Geyser-Fabric.jar -+ if-no-files-found: error -+ - name: Archive artifacts (Geyser Standalone) -+ uses: actions/upload-artifact@v3 -+ 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@v3 -+ 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@v3 -+ 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@v3 -+ if: success() -+ with: -+ name: Geyser Velocity -+ path: bootstrap/velocity/build/libs/Geyser-Velocity.jar -+ if-no-files-found: error --- -2.39.1.windows.1 - diff --git a/patches/0006-change-to-the-default-branch.patch b/patches/0006-change-to-the-default-branch.patch deleted file mode 100644 index a39f27ed8e1..00000000000 --- a/patches/0006-change-to-the-default-branch.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 71a0a337f6cd5e2e83cc66b2cc91aa1b3aa31196 Mon Sep 17 00:00:00 2001 -From: Shanwer -Date: Mon, 25 Dec 2023 14:48:33 +0800 -Subject: [PATCH 6/7] change to the default branch - ---- - .github/workflows/gradle.yml | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml -index 5859f10f..e720a15b 100644 ---- a/.github/workflows/gradle.yml -+++ b/.github/workflows/gradle.yml -@@ -34,35 +34,35 @@ jobs: - arguments: build - - name: Archive artifacts (Geyser Fabric) - # See https://github.com/actions/upload-artifact/commits -- uses: actions/upload-artifact@v3 -+ uses: actions/upload-artifact@main - if: success() - with: - name: Geyser Fabric - path: bootstrap/fabric/build/libs/Geyser-Fabric.jar - if-no-files-found: error - - name: Archive artifacts (Geyser Standalone) -- uses: actions/upload-artifact@v3 -+ uses: actions/upload-artifact@main - 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@v3 -+ uses: actions/upload-artifact@main - 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@v3 -+ uses: actions/upload-artifact@main - 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@v3 -+ uses: actions/upload-artifact@main - if: success() - with: - name: Geyser Velocity --- -2.39.1.windows.1 - diff --git a/patches/0007-repo.patch b/patches/0007-repo.patch deleted file mode 100644 index 7f085081f05..00000000000 --- a/patches/0007-repo.patch +++ /dev/null @@ -1,25 +0,0 @@ -From af2f43e0268536a1bcde07ab4843f699b40b37ae Mon Sep 17 00:00:00 2001 -From: Shanwer -Date: Mon, 25 Dec 2023 14:50:53 +0800 -Subject: [PATCH 7/7] repo - ---- - .github/workflows/gradle.yml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml -index e720a15b..67936615 100644 ---- a/.github/workflows/gradle.yml -+++ b/.github/workflows/gradle.yml -@@ -29,7 +29,7 @@ jobs: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle -- uses: gradle/gradle-build-action@v3 # v2.6.0 -+ uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 - with: - arguments: build - - name: Archive artifacts (Geyser Fabric) --- -2.39.1.windows.1 -