diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 5700463..1f38d0e 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -231,10 +231,21 @@ jobs: with: path: build/ + - name: Push Tooth + working-directory: ${{env.GITHUB_WORKSPACE}} + if: github.event.inputs.status == 'stable' + run: | + cd Scripts + ./UploadTooth.sh ${{ github.event.inputs.tag }} + env: + REPO_KEY: ${{secrets.ACTIONS_TOKEN}} + USERNAME: github-actions[bot] + shell: bash + - name: Pack artifacts run: | cd build/ - zip -9r LiteLoaderBDS.zip LiteLoaderBDS/* + zip -9r LiteLoaderBDS-${{ github.event.inputs.tag }}.zip LiteLoaderBDS/* zip -9r PDB.zip PDB/* zip -9r Modules.zip PeEditor PreLoader LiteLoader ScriptEngine LLParticle LLPermission shell: bash @@ -247,7 +258,7 @@ jobs: tag: ${{ github.event.inputs.tag }} bodyFile: RELEASE_NOTES.md artifacts: | - build/LiteLoaderBDS.zip + build/LiteLoaderBDS-${{ github.event.inputs.tag }}.zip build/Modules.zip build/PDB.zip env: diff --git a/Scripts/UploadTooth.sh b/Scripts/UploadTooth.sh new file mode 100644 index 0000000..b1fb68f --- /dev/null +++ b/Scripts/UploadTooth.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +TOOTH_REMOTE_PATH=https://github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git + +cd .. +echo [INFO] Fetching LiteLoaderBDS-Legacy Tooth to GitHub ... + +# 获取标签 +now_tag=$(git describe --tags --always | cut -d "-" -f 1) + +echo NOW_TAG $now_tag + +echo [INFO] LiteLoaderBDS-Legacy Tooth Pulling from remote... +echo +git clone ${TOOTH_REMOTE_PATH} Tooth + +# cd LiteLoaderBDS-Legacy +# git fetch --all +# git reset --hard origin/Protocol-408 +# git checkout Protocol-408 +# cd .. + +echo +echo [INFO] Fetching LiteLoaderBDS-Legacy Tooth to GitHub finished +echo + + +# copy all from build/sdk to LiteLoaderSDK +cp -r build/LiteLoaderBDS/* Tooth + +cd Tooth +version=$1 +vers=" \"version\": \"${version:1}\"," + +#modify tooth.json +sed -i "4c\ ${vers}" ./tooth.json + + +now_status=$(git status . -s) +if [ "$now_status" ]; then + echo [INFO] Modified files found. + echo + git add . + git commit -m "${now_tag}" + git tag ${now_tag} + + echo + echo [INFO] Pushing to origin... + echo + + git push https://%USERNAME%:%REPO_KEY%@github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git Protocol-408 + git push --tags https://%USERNAME%:%REPO_KEY%@github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git Protocol-408 + + cd .. + echo + echo [INFO] Upload finished. + echo +else + cd .. + echo + echo + echo [INFO] No modified files found. + echo [INFO] No need to Upgrade LiteLoaderBDS-Legacy. +fi \ No newline at end of file