name: Pack ZGM mission PBO files on: push: branches: [main] jobs: GetMissionList: name: Get ZGM mission list runs-on: windows steps: - name: Diagnostics run: | echo "repository: ${{ gitea.repository }}" echo "ref: ${{ gitea.ref }}" echo "ref_name: ${{ gitea.ref_name }}" echo "sha: ${{ gitea.sha }}" echo "api_url: ${{ gitea.api_url }}" echo "workflow: ${{ gitea.workflow }}" - name: Checkout missions uses: actions/checkout@v3 with: repository: 17th-Ranger-Battalion-ORG/MissionsForZGM fetch-depth: 0 ref: 'main' token: ${{ secrets.RELEASE_TOKEN }} - name: Get current directory list run: | Get-ChildItem - name: Get mission list run: | Get-ChildItem MissionsForZGM/* CreatePboFiles: name: Create PBO files runs-on: windows steps: - name: Diagnostics run: | echo "repository: ${{ gitea.repository }}" echo "ref: ${{ gitea.ref }}" echo "ref_name: ${{ gitea.ref_name }}" echo "sha: ${{ gitea.sha }}" echo "api_url: ${{ gitea.api_url }}" echo "workflow: ${{ gitea.workflow }}" - name: Checkout template uses: actions/checkout@v3 with: fetch-depth: 0 ref: 'main' token: ${{ secrets.RELEASE_TOKEN }} path: template - name: Prepare template run: | Remove-Item -Recurse template\aaFrameworkUtils Remove-Item -Recurse template\framework\x Remove-Item -Recurse template\.git* - name: Checkout missions uses: actions/checkout@v3 with: repository: 17th-Ranger-Battalion-ORG/MissionsForZGM fetch-depth: 0 ref: 'main' token: ${{ secrets.RELEASE_TOKEN }} path: zgm-files - name: Get mission list run: | Get-ChildItem - name: Get mission list run: | Get-ChildItem zgm-files - name: Prepare tools run: | mkdir packed-files Remove-Item -Recurse template\.git - name: Pack PBOs run: | $date = Get-Date -Format "yyyy-MM-dd" foreach ($file in Get-ChildItem zgm-files\missions) { $map = (Get-Item zgm-files\missions\$file).Basename.split('\.')[-1] Copy-Item zgm-files\missions\$file\mission.sqm template\ (Get-Content .\template\mission_settings.hpp).Replace("MISSION AUTHOR","17th Ranger Battalion") | Set-Content .\template\mission_settings.hpp (Get-Content .\template\mission_settings.hpp).Replace("THIS APPEARS ON TOP OF THE LOADING SCREEN IMAGE","GAME MASTER") | Set-Content .\template\mission_settings.hpp (Get-Content .\template\mission_settings.hpp).Replace("THIS APPEARS BELOW THE LOADING SCREEN IMAGE","Forcing you to respawn since 2013") | Set-Content .\template\mission_settings.hpp (Get-Content .\template\mission_settings.hpp).Replace("THIS IS THE NAME ON THE #MISSIONS LIST","BASE ZGM $date") | Set-Content .\template\mission_settings.hpp (Get-Content .\template\mission_settings.hpp).Replace("THIS IS WHERE YOU DESCRIBE THE MISSION IN THE #MISSION LIST","I have 2 headless clients, and am most likely an airfield spawn") | Set-Content .\template\mission_settings.hpp (Get-Content .\template\mission_settings.hpp).Replace("MY SERIES NAME","ZEUS GAME MASTER") | Set-Content .\template\mission_settings.hpp $missionName = Get-Content .\template\mission.sqm | Select-String -Pattern 'sourceName="(.*)";' $missionName = $missionName.Matches.groups[1].value (Get-Content .\template\mission.sqm).Replace($missionName,"FRAMEWORK ZGM $date") | Set-Content .\template\mission.sqm zgm-files\tools\PBOconsole.exe -pack template packed-files\BASE_ZGM_$date.$map.pbo } - name: List PBOs run: | cd packed-files Get-ChildItem - name: Backup artifacts from runner uses: actions/upload-artifact@v3 with: name: zgm-pbo-files path: packed-files/* - name: Create release uses: https://gitea.com/actions/gitea-release-action@v1.1.6 with: tag_name: 'snapshot-release' release_name: 'snapshot-release' files: |- packed-files/** api_key: '${{secrets.RELEASE_TOKEN}}'