name: Generate Draft Release

on:
  push:
    branches:
      - main
      - "*-release"

jobs:
  package_chart:
    runs-on: ubuntu-latest

    steps:
      - name: Check out Git repository
        uses: actions/checkout@v3

      - name: Get Version
        run: |
          echo "version=$(jq -r .version package.json)" >> "$GITHUB_ENV"

      - name: Make Draft Release
        uses: softprops/action-gh-release@v1
        with:
          name: "Browsertrix Crawler v${{ env.version }}"
          tag_name: v${{ env.version }}
          draft: true
