diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec68f68..85ad246 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: run-demo +name: build-and-release-demo on: # schedule: @@ -49,6 +49,9 @@ jobs: -package ` -archive - - name: Run simulation - run: | - docker exec unreal C:\workspace\checkout\Builds\Windows\SentryTower.exe -Unattended -nullrhi --idle + - name: Upload SentryTower.exe + uses: actions/upload-artifact@v4 + with: + name: SentryTower + path: checkout/Builds/Windows/SentryTower.exe + retention-days: 90 \ No newline at end of file diff --git a/.github/workflows/run-demo.yml b/.github/workflows/run-demo.yml new file mode 100644 index 0000000..af1f784 --- /dev/null +++ b/.github/workflows/run-demo.yml @@ -0,0 +1,36 @@ +name: run-demo + +on: + # schedule: + # - cron: '0 */2 * * *' # every two hours + workflow_dispatch: + +jobs: + run: + name: Run Demo + runs-on: windows-latest + + steps: + - name: Get latest build run + id: get-run + run: | + $runs = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/workflows/ci.yml/runs?status=success&per_page=1" -Headers @{Authorization="Bearer ${{ secrets.GITHUB_TOKEN }}"} + $runId = $runs.workflow_runs[0].id + echo "run-id=$runId" >> $env:GITHUB_OUTPUT + + - name: Download SentryTower.exe + uses: actions/download-artifact@v4 + with: + name: SentryTower + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + run-id: ${{ steps.get-run.outputs.run-id }} + + - name: Run simulation + run: | + .\SentryTower.exe -Unattended -nullrhi --idle + if ($LASTEXITCODE -eq 0) { + Write-Error "Expected non-zero exit code but got 0" + exit 1 + } + Write-Output "Simulation completed with expected non-zero exit code: $LASTEXITCODE" \ No newline at end of file