name: Build Pipeline on: push: branches: - main jobs: FLHook: runs-on: windows-latest if: ${{ !contains(github.event.head_commit.message, 'Update FLHook') }} steps: - name: Get last FLHook tag uses: actions/checkout@v3 with: sparse-checkout: .github/workflows/flhooktag sparse-checkout-cone-mode: false path: check - name: Download latest FLHook release id: download-release uses: robinraju/release-downloader@v1.8 with: repository: "TheStarport/FLHook" fileName: "Release.zip" latest: true extract: true - name: Is there a new release? env: TAG: ${{steps.download-release.outputs.tag_name}} run: if( (Get-Content -Path .\check\.github\workflows\flhooktag) -ne $env:TAG ) { echo "NEW=true" >> $env:GITHUB_ENV } - name: Checkout full repo if: env.NEW == 'true' uses: actions/checkout@v3 with: path: staging token: ${{ secrets.PAT }} sparse-checkout: | .github/workflows/flhooktag EXE sparse-checkout-cone-mode: false - name: Copy new release if: env.NEW == 'true' run: | copy Release/*.* staging/EXE New-Item -ItemType Directory -Force -Path staging/EXE/plugins copy Release/plugins/afk.dll staging/EXE/plugins copy Release/plugins/autobuy.dll staging/EXE/plugins copy Release/plugins/betting.dll staging/EXE/plugins copy Release/plugins/bountyhunt.dll staging/EXE/plugins copy Release/plugins/cash_manager.dll staging/EXE/plugins copy Release/plugins/condata.dll staging/EXE/plugins copy Release/plugins/crash_catcher.dll staging/EXE/plugins copy Release/plugins/kill_tracker.dll staging/EXE/plugins copy Release/plugins/mark.dll staging/EXE/plugins copy Release/plugins/message.dll staging/EXE/plugins copy Release/plugins/misc_commands.dll staging/EXE/plugins copy Release/plugins/rename.dll staging/EXE/plugins copy Release/plugins/restarts.dll staging/EXE/plugins copy Release/plugins/sound_manager.dll staging/EXE/plugins copy Release/plugins/stats.dll staging/EXE/plugins - name: Commit to branch if: env.NEW == 'true' env: TAG: ${{steps.download-release.outputs.tag_name}} run: | cd staging echo $env:TAG > .github/workflows/flhooktag git config user.name github-actions git config user.email github-actions@github.com git add EXE git add .github/workflows/flhooktag git commit -m "Update FLHook to $env:TAG" git push