diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59aa890869e..6261f489c46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,9 @@ name: Build on: + workflow_run: + workflows: ["Sync with Upstream"] # 监听同步上游完成后运行 + types: ["completed"] workflow_dispatch: push: branches-ignore: @@ -20,6 +23,7 @@ on: jobs: build: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} # 上游完成且成功才运行 steps: - name: Get Release Info id: release-info diff --git a/.github/workflows/sync_with_upstream.yml b/.github/workflows/sync_with_upstream.yml index 9e569a9c074..9ff42ff4519 100644 --- a/.github/workflows/sync_with_upstream.yml +++ b/.github/workflows/sync_with_upstream.yml @@ -5,6 +5,9 @@ on: - cron: '0 0 * * *' workflow_dispatch: +permissions: + contents: write # 允许写入 + jobs: sync: runs-on: ubuntu-latest @@ -17,8 +20,8 @@ jobs: - name: Configure Git run: | - git config user.name 'Shanwer' - git config user.email 'Shanwer@qq.com' + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' - name: Add upstream remote run: git remote add upstream https://github.com/GeyserMC/Geyser.git @@ -26,6 +29,15 @@ jobs: - name: Fetch upstream changes run: git fetch upstream + - name: Check for updates + run: | + UPSTREAM_SHA=$(git rev-parse upstream/master) + LOCAL_SHA=$(git rev-parse HEAD) + if [ "$LOCAL_SHA" == "$UPSTREAM_SHA" ]; then + echo "No changes detected." + exit 1 + fi + - name: Merge upstream changes run: | git merge upstream/master || { diff --git a/README.md b/README.md index 7cedf3d908e..6be2e4556b3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ -### 下载须知: -这是Geyser的非官方版本,旨在恢复了不安全的mojang账号登录功能以提供Authlib-injector支持,该Repo使用GitHub Action与Upstream每日定时同步以保证源代码最新,但由于Action的限制,不能做到同步代码后自动构建,需要更新可以自行clone编译或者踢我一下来开一个Action的手动构建。我自己也是服主,所以一般基岩协议版本更新的时候我都会在那构建一下。 +### 关于本仓库 +这是 Geyser 的非官方版本。本版本恢复了被 Geyser 官方移除的 Mojang 账号登录功能。Mojang 账号登录功能是提供 Authlib-injector 功能所必须的。本仓库使用 GitHub Action 进行自动同步、合并上游,以保证源代码跟进上游代码,并自动构建。构建于每日正午(12点)生成在 [Build](https://github.com/NiuexDev/tbc-Geyser-with-mojang-login-build/actions/workflows/build.yml) Workflow 中。 -This is the unofficial version of Geyser. It aims to revert the insecure function of mojang account login which gives you access to inject authlib. This repo uses GitHub Action to keep up-todate with the upstream everyday, however, due to the action's limit, it cannot automatically build after syncing the source code. If you need update, you can clone it and build by yourself or inform me to launch a workflow dispatch. Me myself am a server owner and whenever the bedrock protocol updates I will build it on action. +#### About this repository +This is an unofficial version of Geyser. It restores the Mojang account login feature removed by the official repository, which is essential for Authlib-injector support. This repository uses GitHub Actions to automatically sync and merge with the upstream daily, ensuring the source code stays up-to-date. Automated builds are generated every day at 12:00 PM in the [Build](https://github.com/NiuexDev/tbc-Geyser-with-mojang-login-build/actions/workflows/build.yml) workflow. Geyser