Skip to content

Commit

Permalink
ci: fix update sdk
Browse files Browse the repository at this point in the history
chore: rename UploadSDK.cmd -> UpdateSDK.cmd
  • Loading branch information
ShrBox committed Apr 1, 2023
1 parent a7facc8 commit c143606
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
if: steps.cache-bds-lib.outputs.cache-hit != 'true'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir LiteLoader\lib
cd Tools
LLPeEditor.exe -l --pdb Server/bedrock_server.pdb -o ../LiteLoader/lib
shell: cmd
mkdir LiteLoader/lib
cd tools
./LLPeEditor.exe -l --pdb Server/bedrock_server.pdb -o ../LiteLoader/lib
shell: bash

- name: Set LITELOADER_VERSION_COMMIT_SHA
working-directory: ${{ env.GITHUB_WORKSPACE }}
Expand All @@ -59,28 +59,28 @@ jobs:
- name: Configure CMake (MSVC)
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
shell: cmd
shell: bash

- name: Build all
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
shell: cmd
shell: bash

- name: Pack output
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target PackOutput
shell: cmd
shell: bash

- name: Pack SDK on push event
if: github.event_name == 'push'
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target PackSDK
shell: cmd
shell: bash

- name: Configure CMake (ClangCL)
run: |
cmake -B ${{github.workspace}}/build_clang -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T clangcl
shell: cmd
shell: bash

- name: Build SymDBHelper
run: |
Expand All @@ -99,13 +99,17 @@ jobs:
if: github.event_name == 'push'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir ~/.ssh
ssh-keygen -R github.com
curl -L https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts
echo "-----BEGIN OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_rsa
echo ${{secrets.DEPLOY_KEY}} >> ~/.ssh/id_rsa
echo "-----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_rsa
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
cd scripts
./UploadSDK.cmd action
env:
DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
shell: cmd
cmd /c "UpdateSDK.cmd action"
shell: bash

- name: Download LLMoney
working-directory: ${{ env.GITHUB_WORKSPACE }}
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ jobs:
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir LiteLoader\lib
cd Tools
LLPeEditor.exe -l --pdb Server/bedrock_server.pdb -o ../LiteLoader/lib
shell: cmd
cd tools
./LLPeEditor.exe -l --pdb Server/bedrock_server.pdb -o ../LiteLoader/lib
shell: bash

- name: Set LITELOADER_VERSION_COMMIT_SHA
working-directory: ${{ env.GITHUB_WORKSPACE }}
Expand All @@ -88,27 +88,27 @@ jobs:
- name: Configure CMake (MSVC)
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
shell: cmd
shell: bash

- name: Build all
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
shell: cmd
shell: bash

- name: Pack output
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target PackOutput
shell: cmd
shell: bash

- name: Pack SDK
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target PackSDK
shell: cmd
shell: bash

- name: Configure CMake (ClangCL)
run: |
cmake -B ${{github.workspace}}/build_clang -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T clangcl
shell: cmd
shell: bash

- name: Build SymDBHelper
run: cmake --build ${{github.workspace}}/build_clang --config ${{env.BUILD_TYPE}} --target SymDBHelper
Expand All @@ -123,14 +123,17 @@ jobs:
- name: Update C++ SDK
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir ~/.ssh
ssh-keygen -R github.com
curl -L https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts
echo "-----BEGIN OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_rsa
echo ${{secrets.DEPLOY_KEY}} >> ~/.ssh/id_rsa
echo "-----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_rsa
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
cd scripts
./UploadSDK.cmd action release
env:
REPO_KEY: ${{secrets.PUSH_TOKEN}}
USERNAME: github-actions[bot]
shell: cmd
cmd /c "UpdateSDK.cmd action"
shell: bash

- name: Download LLMoney
working-directory: ${{ env.GITHUB_WORKSPACE }}
Expand Down
4 changes: 0 additions & 4 deletions scripts/UploadSDK.cmd → scripts/UpdateSDK.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ if "%LL_SDK_NOW_STATUS%" neq "" (
git push origin %LL_SDK_NOW_BRANCH%
git push --tags origin %LL_SDK_NOW_BRANCH%
) else (
mkdir %USERPROFILE%\.ssh
echo "-----BEGIN OPENSSH PRIVATE KEY-----" >> %USERPROFILE%\.ssh\id_rsa
echo %DEPLOY_KEY% >> ~\.ssh\id_rsa
echo "-----END OPENSSH PRIVATE KEY-----" >> %USERPROFILE%\.ssh\id_rsa
git push git@github.com:LiteLDev/SDK-CPP.git %LL_SDK_NOW_BRANCH%
git push --tags git@github.com:LiteLDev/SDK-CPP.git %LL_SDK_NOW_BRANCH%
)
Expand Down

0 comments on commit c143606

Please sign in to comment.