From bfc7568f02adc6669dedecedb1911eb43e40a2fe Mon Sep 17 00:00:00 2001 From: Morb <14136326+Morb0@users.noreply.github.com> Date: Sun, 28 Apr 2024 17:31:04 +0300 Subject: [PATCH] Update publish.yml --- .github/workflows/publish.yml | 78 ++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 14ab677bd9a..051db081bf9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,16 +5,82 @@ concurrency: on: workflow_dispatch: + schedule: + - cron: '0 6 * * *' jobs: build: runs-on: ubuntu-latest + steps: - - name: Send POST-request + - uses: actions/checkout@v3.6.0 + with: + submodules: 'recursive' + + # Corvax-Secrets-Start + - name: Setup secrets + env: + SSH_KEY: ${{ secrets.SECRETS_PRIVATE_KEY }} + if: ${{ env.SSH_KEY != '' }} + run: | + mkdir ~/.ssh + echo "${{ secrets.SECRETS_PRIVATE_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + echo "HOST *" > ~/.ssh/config + echo "StrictHostKeyChecking no" >> ~/.ssh/config + git -c submodule.Secrets.update=checkout submodule update --init + cp -R Secrets/Resources/Prototypes Resources/Prototypes/CorvaxSecrets + cp -R Secrets/Resources/ServerPrototypes Resources/Prototypes/CorvaxSecretsServer + cp -R Secrets/Resources/Locale Resources/Locale/ru-RU/corvax-secrets + cp -R Secrets/Resources/Textures Resources/Textures/CorvaxSecrets + # Corvax-Secrets-End + + - name: Setup .NET Core + uses: actions/setup-dotnet@v3.2.0 + with: + dotnet-version: 8.0.x + + - name: Get Engine Tag + run: | + cd RobustToolbox + git fetch --depth=1 + + - name: Install dependencies + run: dotnet restore + + - name: Build Packaging + run: dotnet build Content.Packaging --configuration Release --no-restore /m + + - name: Package server + run: dotnet run --project Content.Packaging server --platform win-x64 --platform linux-x64 --platform osx-x64 --platform linux-arm64 + + - name: Package client + run: dotnet run --project Content.Packaging client --no-wipe-release + + - name: Update Build Info + env: + FORK_ID: ${{ vars.FORK_ID }} + run: Tools/gen_build_info.py + + - name: Shuffle files around + run: | + mkdir "release/${{ github.sha }}" + mv release/*.zip "release/${{ github.sha }}" + + - name: Upload files to mothership + uses: burnett01/rsync-deployments@5.2 + with: + switches: -avzr --ignore-existing + path: "release/${{ github.sha }}" + remote_path: ${{ secrets.BUILDS_PATH }} + remote_host: ${{ secrets.BUILDS_HOST }} + remote_user: ${{ secrets.BUILDS_USERNAME }} + remote_key: ${{ secrets.BUILDS_SSH_KEY }} + + - name: Update manifest JSON uses: appleboy/ssh-action@master with: - host: ${{ secrets.BUILD_HOST }} - username: ${{ secrets.BUILD_USER }} - password: ${{ secrets.BUILD_PASS }} - port: ${{ secrets.BUILD_PORT }} - script: sh update_frontier.sh &> /dev/null + host: ${{ secrets.BUILDS_HOST }} + username: ${{ secrets.BUILDS_USERNAME }} + key: ${{ secrets.BUILDS_SSH_KEY }} + script: node ~/scripts/push_to_manifest.js -fork ${{ vars.FORK_ID }} -id ${{ github.sha }}