name: Pre-release

on:
    workflow_dispatch:
    push:
        tags:
            - 'v[0-9]+.[0-9]+.[0-9]+-[a-z]+*' # e.g v1.2.3-alpha

jobs:
    checks:
        name: Run code checks
        uses: "./.github/workflows/checks.yml"
        secrets: inherit

    # publish_image:
    # image will be published in e2e-tests.yml workflow
    #     name: Publish Docker image
    #     uses: './.github/workflows/publish-image.yml'
    #     secrets: inherit

    e2e_tests:
        name: Run e2e tests
        needs: checks
        uses: "./.github/workflows/e2e-tests.yml"
        secrets: inherit

    label_issues:
        name: Add pre-release label to issues
        uses: './.github/workflows/label-issues-in-release.yml'
        with:
            tag: ${{ github.ref_name }}
            label_name: 'pre-release'
            label_description: Tasks in pre-release right now
        secrets: inherit

    upload_source_maps:
        name: Upload source maps to Sentry
        uses: './.github/workflows/upload-source-maps.yml'
        secrets: inherit
