Build only when #build
directive appears in PR body
#322
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Development builds | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
types: [opened, synchronize, edited] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
prepare: | |
name: 'Prepare' | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/develop' || contains(github.event.pull_request.body, '#build') }} | |
steps: | |
- id: initial_scene | |
run: | | |
initial_scene=$(echo $PR_DESCRIPTION | grep -Eo '#build [A-Za-z ]+' | cut -b 8- | sed -e 's/ /_/g') | |
echo "initial_scene=$initial_scene" | tee -a $GITHUB_OUTPUT | |
env: | |
PR_DESCRIPTION: ${{ github.event.pull_request.body }} | |
outputs: | |
initial_scene: ${{ steps.initial_scene.outputs.initial_scene }} | |
windows_build: | |
name: 'Build for Windows' | |
needs: prepare | |
uses: ./.github/workflows/windows.yml | |
secrets: inherit | |
with: | |
initial_scene: ${{ needs.prepare.outputs.initial_scene }} | |
branch_name: ${{ github.head_ref || github.ref_name }} | |
commit_hash: ${{ github.event.pull_request.head.sha || github.sha }} | |
macos_build: | |
name: 'Build for macOS' | |
needs: prepare | |
uses: ./.github/workflows/macos.yml | |
secrets: inherit | |
with: | |
initial_scene: ${{ needs.prepare.outputs.initial_scene }} | |
branch_name: ${{ github.head_ref || github.ref_name }} | |
commit_hash: ${{ github.event.pull_request.head.sha || github.sha }} | |
steam: | |
name: 'Upload to Steam' | |
needs: [windows_build, macos_build] | |
uses: ./.github/workflows/steam.yml | |
secrets: inherit | |
s3: | |
name: 'Upload to S3' | |
needs: [windows_build, macos_build] | |
uses: ./.github/workflows/s3.yml | |
secrets: inherit |