name: Publish a pre-release

permissions:
  contents: write

on:
  push:
    branches:
    - develop

jobs:
  package_multiplatform:
    name: Build prerelease assets
    if: vars.PRERELEASE_ENABLE == 'true'
    uses: ./.github/workflows/job_build_game.yml
    secrets: inherit

  publish_prerelease:
    if: vars.PRERELEASE_ENABLE == 'true'
    name: Create a prerelease
    needs:
      - package_multiplatform
    with:
      release_name: 'Development snapshot'
      draft: false
      prerelease: true
      tag_name: 'latest'
    uses: ./.github/workflows/job_release.yml
