Release

# GENERATED, DO NOT EDIT!
# To change, edit `src/python/pants_release/generate_github_workflows.py` and run:
#   ./pants run src/python/pants_release/generate_github_workflows.py

jobs:
  build_wheels_linux_arm64:
    container:
      image: ghcr.io/pantsbuild/wheel_build_aarch64:v3-8384c5cf
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    if: github.repository_owner == 'pantsbuild'
    name: Build wheels (Linux-ARM64)
    needs:
    - release_info
    runs-on:
    - self-hosted
    - Linux
    - ARM64
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        ref: ${{ needs.release_info.outputs.build-ref }}
    - name: Configure Git
      run: git config --global safe.directory "$GITHUB_WORKSPACE"
    - name: Install rustup
      run: 'curl --proto ''=https'' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s --
        -v -y --default-toolchain none

        echo "${HOME}/.cargo/bin" >> $GITHUB_PATH

        '
    - name: Expose Pythons
      run: 'echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH

        echo "/opt/python/cp38-cp38/bin" >> $GITHUB_PATH

        echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH

        '
    - name: Install Protoc
      uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        version: 23.x
    - env:
        PANTS_CONFIG_FILES: +['pants.ci.toml','pants.ci.aarch64.toml']
      name: Build wheels
      run: ./pants run src/python/pants_release/release.py -- build-wheels
    - env:
        PANTS_CONFIG_FILES: +['pants.ci.toml','pants.ci.aarch64.toml']
      name: Build Pants PEX
      run: ./pants package src/python/pants:pants-pex
    - continue-on-error: true
      if: always()
      name: Upload pants.log
      uses: actions/upload-artifact@v3
      with:
        name: logs-wheels-and-pex-Linux-ARM64
        path: .pants.d/workdir/*.log
    - if: needs.release_info.outputs.is-release == 'true'
      name: Upload Wheel and Pex
      run: "PANTS_VER=$(PEX_INTERPRETER=1 dist/src.python.pants/pants-pex.pex -c \"\
        import pants.version;print(pants.version.VERSION)\")\nPY_VER=$(PEX_INTERPRETER=1\
        \ dist/src.python.pants/pants-pex.pex -c \"import sys;print(f'cp{sys.version_info[0]}{sys.version_info[1]}')\"\
        )\nPLAT=$(PEX_INTERPRETER=1 dist/src.python.pants/pants-pex.pex -c \"import\
        \ os;print(f'{os.uname().sysname.lower()}_{os.uname().machine.lower()}')\"\
        )\nPEX_FILENAME=pants.$PANTS_VER-$PY_VER-$PLAT.pex\n\nmv dist/src.python.pants/pants-pex.pex\
        \ dist/src.python.pants/$PEX_FILENAME\n\ncurl -L --fail \\\n    -X POST \\\
        \n    -H \"Authorization: Bearer ${{ github.token }}\" \\\n    -H \"Content-Type:\
        \ application/octet-stream\" \\\n    ${{ needs.release_info.outputs.release-asset-upload-url\
        \ }}?name=$PEX_FILENAME \\\n    --data-binary \"@dist/src.python.pants/$PEX_FILENAME\"\
        \n\nWHL=$(find dist/deploy/wheels/pantsbuild.pants -type f -name \"pantsbuild.pants-*.whl\"\
        )\ncurl -L --fail \\\n    -X POST \\\n    -H \"Authorization: Bearer ${{ github.token\
        \ }}\" \\\n    -H \"Content-Type: application/octet-stream\" \\\n    \"${{\
        \ needs.release_info.outputs.release-asset-upload-url }}?name=$(basename $WHL)\"\
        \ \\\n    --data-binary \"@$WHL\";\n"
    timeout-minutes: 90
  build_wheels_linux_x86_64:
    container:
      image: quay.io/pypa/manylinux2014_x86_64:latest
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    if: github.repository_owner == 'pantsbuild'
    name: Build wheels (Linux-x86_64)
    needs:
    - release_info
    runs-on:
    - ubuntu-20.04
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        ref: ${{ needs.release_info.outputs.build-ref }}
    - name: Configure Git
      run: git config --global safe.directory "$GITHUB_WORKSPACE"
    - name: Install rustup
      run: 'curl --proto ''=https'' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s --
        -v -y --default-toolchain none

        echo "${HOME}/.cargo/bin" >> $GITHUB_PATH

        '
    - name: Expose Pythons
      run: 'echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH

        echo "/opt/python/cp38-cp38/bin" >> $GITHUB_PATH

        echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH

        '
    - name: Install Protoc
      uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        version: 23.x
    - name: Install Go
      uses: actions/setup-go@v3
      with:
        go-version: 1.19.5
    - env:
        PANTS_PROCESS_EXECUTION_LOCAL_PARALLELISM: '1'
      name: Build wheels
      run: ./pants run src/python/pants_release/release.py -- build-wheels
    - env:
        PANTS_PROCESS_EXECUTION_LOCAL_PARALLELISM: '1'
      name: Build Pants PEX
      run: ./pants package src/python/pants:pants-pex
    - continue-on-error: true
      if: always()
      name: Upload pants.log
      uses: actions/upload-artifact@v3
      with:
        name: logs-wheels-and-pex-Linux-x86_64
        path: .pants.d/workdir/*.log
    - if: needs.release_info.outputs.is-release == 'true'
      name: Upload Wheel and Pex
      run: "PANTS_VER=$(PEX_INTERPRETER=1 dist/src.python.pants/pants-pex.pex -c \"\
        import pants.version;print(pants.version.VERSION)\")\nPY_VER=$(PEX_INTERPRETER=1\
        \ dist/src.python.pants/pants-pex.pex -c \"import sys;print(f'cp{sys.version_info[0]}{sys.version_info[1]}')\"\
        )\nPLAT=$(PEX_INTERPRETER=1 dist/src.python.pants/pants-pex.pex -c \"import\
        \ os;print(f'{os.uname().sysname.lower()}_{os.uname().machine.lower()}')\"\
        )\nPEX_FILENAME=pants.$PANTS_VER-$PY_VER-$PLAT.pex\n\nmv dist/src.python.pants/pants-pex.pex\
        \ dist/src.python.pants/$PEX_FILENAME\n\ncurl -L --fail \\\n    -X POST \\\
        \n    -H \"Authorization: Bearer ${{ github.token }}\" \\\n    -H \"Content-Type:\
        \ application/octet-stream\" \\\n    ${{ needs.release_info.outputs.release-asset-upload-url\
        \ }}?name=$PEX_FILENAME \\\n    --data-binary \"@dist/src.python.pants/$PEX_FILENAME\"\
        \n\nWHL=$(find dist/deploy/wheels/pantsbuild.pants -type f -name \"pantsbuild.pants-*.whl\"\
        )\ncurl -L --fail \\\n    -X POST \\\n    -H \"Authorization: Bearer ${{ github.token\
        \ }}\" \\\n    -H \"Content-Type: application/octet-stream\" \\\n    \"${{\
        \ needs.release_info.outputs.release-asset-upload-url }}?name=$(basename $WHL)\"\
        \ \\\n    --data-binary \"@$WHL\";\n"
    - if: needs.release_info.outputs.is-release == 'true'
      name: Upload testutil Wheel
      run: "WHL=$(find dist/deploy/wheels/pantsbuild.pants -type f -name \"pantsbuild.pants.testutil*.whl\"\
        )\ncurl -L --fail \\\n    -X POST \\\n    -H \"Authorization: Bearer ${{ github.token\
        \ }}\" \\\n    -H \"Content-Type: application/octet-stream\" \\\n    \"${{\
        \ needs.release_info.outputs.release-asset-upload-url }}?name=$(basename $WHL)\"\
        \ \\\n    --data-binary \"@$WHL\";\n"
    timeout-minutes: 90
  build_wheels_macos10_15_x86_64:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    if: github.repository_owner == 'pantsbuild'
    name: Build wheels (macOS10-15-x86_64)
    needs:
    - release_info
    runs-on:
    - self-hosted
    - macOS-10.15-X64
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        ref: ${{ needs.release_info.outputs.build-ref }}
    - name: Install Protoc
      uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        version: 23.x
    - name: Set rustup profile
      run: rustup set profile default
    - name: Cache Rust toolchain
      uses: actions/cache@v3
      with:
        key: macOS10-15-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
          }}-v2
        path: '~/.rustup/toolchains/1.78.0-*

          ~/.rustup/update-hashes

          ~/.rustup/settings.toml

          '
    - name: Cache Cargo
      uses: benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1
      with:
        cache-bin: 'false'
        shared-key: engine
        workspaces: src/rust/engine
    - name: Install Protoc
      uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        version: 23.x
    - name: Install Go
      uses: actions/setup-go@v3
      with:
        go-version: 1.19.5
    - env:
        ARCHFLAGS: -arch x86_64
      name: Build wheels
      run: ./pants run src/python/pants_release/release.py -- build-wheels
    - env:
        ARCHFLAGS: -arch x86_64
      name: Build Pants PEX
      run: ./pants package src/python/pants:pants-pex
    - continue-on-error: true
      if: always()
      name: Upload pants.log
      uses: actions/upload-artifact@v3
      with:
        name: logs-wheels-and-pex-macOS10-15-x86_64
        path: .pants.d/workdir/*.log
    - if: needs.release_info.outputs.is-release == 'true'
      name: Upload Wheel and Pex
      run: "PANTS_VER=$(PEX_INTERPRETER=1 dist/src.python.pants/pants-pex.pex -c \"\
        import pants.version;print(pants.version.VERSION)\")\nPY_VER=$(PEX_INTERPRETER=1\
        \ dist/src.python.pants/pants-pex.pex -c \"import sys;print(f'cp{sys.version_info[0]}{sys.version_info[1]}')\"\
        )\nPLAT=$(PEX_INTERPRETER=1 dist/src.python.pants/pants-pex.pex -c \"import\
        \ os;print(f'{os.uname().sysname.lower()}_{os.uname().machine.lower()}')\"\
        )\nPEX_FILENAME=pants.$PANTS_VER-$PY_VER-$PLAT.pex\n\nmv dist/src.python.pants/pants-pex.pex\
        \ dist/src.python.pants/$PEX_FILENAME\n\ncurl -L --fail \\\n    -X POST \\\
        \n    -H \"Authorization: Bearer ${{ github.token }}\" \\\n    -H \"Content-Type:\
        \ application/octet-stream\" \\\n    ${{ needs.release_info.outputs.release-asset-upload-url\
        \ }}?name=$PEX_FILENAME \\\n    --data-binary \"@dist/src.python.pants/$PEX_FILENAME\"\
        \n\nWHL=$(find dist/deploy/wheels/pantsbuild.pants -type f -name \"pantsbuild.pants-*.whl\"\
        )\ncurl -L --fail \\\n    -X POST \\\n    -H \"Authorization: Bearer ${{ github.token\
        \ }}\" \\\n    -H \"Content-Type: application/octet-stream\" \\\n    \"${{\
        \ needs.release_info.outputs.release-asset-upload-url }}?name=$(basename $WHL)\"\
        \ \\\n    --data-binary \"@$WHL\";\n"
    timeout-minutes: 90
  build_wheels_macos11_arm64:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    if: github.repository_owner == 'pantsbuild'
    name: Build wheels (macOS11-ARM64)
    needs:
    - release_info
    runs-on:
    - self-hosted
    - macOS-11-ARM64
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        ref: ${{ needs.release_info.outputs.build-ref }}
    - name: Install Protoc
      uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        version: 23.x
    - name: Set rustup profile
      run: rustup set profile default
    - name: Cache Rust toolchain
      uses: actions/cache@v3
      with:
        key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
          }}-v2
        path: '~/.rustup/toolchains/1.78.0-*

          ~/.rustup/update-hashes

          ~/.rustup/settings.toml

          '
    - name: Cache Cargo
      uses: benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1
      with:
        cache-bin: 'false'
        shared-key: engine
        workspaces: src/rust/engine
    - name: Install Protoc
      uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        version: 23.x
    - name: Install Go
      uses: actions/setup-go@v3
      with:
        go-version: 1.19.5
    - env:
        ARCHFLAGS: -arch arm64
      name: Build wheels
      run: ./pants run src/python/pants_release/release.py -- build-wheels
    - env:
        ARCHFLAGS: -arch arm64
      name: Build Pants PEX
      run: ./pants package src/python/pants:pants-pex
    - continue-on-error: true
      if: always()
      name: Upload pants.log
      uses: actions/upload-artifact@v3
      with:
        name: logs-wheels-and-pex-macOS11-ARM64
        path: .pants.d/workdir/*.log
    - if: needs.release_info.outputs.is-release == 'true'
      name: Upload Wheel and Pex
      run: "PANTS_VER=$(PEX_INTERPRETER=1 dist/src.python.pants/pants-pex.pex -c \"\
        import pants.version;print(pants.version.VERSION)\")\nPY_VER=$(PEX_INTERPRETER=1\
        \ dist/src.python.pants/pants-pex.pex -c \"import sys;print(f'cp{sys.version_info[0]}{sys.version_info[1]}')\"\
        )\nPLAT=$(PEX_INTERPRETER=1 dist/src.python.pants/pants-pex.pex -c \"import\
        \ os;print(f'{os.uname().sysname.lower()}_{os.uname().machine.lower()}')\"\
        )\nPEX_FILENAME=pants.$PANTS_VER-$PY_VER-$PLAT.pex\n\nmv dist/src.python.pants/pants-pex.pex\
        \ dist/src.python.pants/$PEX_FILENAME\n\ncurl -L --fail \\\n    -X POST \\\
        \n    -H \"Authorization: Bearer ${{ github.token }}\" \\\n    -H \"Content-Type:\
        \ application/octet-stream\" \\\n    ${{ needs.release_info.outputs.release-asset-upload-url\
        \ }}?name=$PEX_FILENAME \\\n    --data-binary \"@dist/src.python.pants/$PEX_FILENAME\"\
        \n\nWHL=$(find dist/deploy/wheels/pantsbuild.pants -type f -name \"pantsbuild.pants-*.whl\"\
        )\ncurl -L --fail \\\n    -X POST \\\n    -H \"Authorization: Bearer ${{ github.token\
        \ }}\" \\\n    -H \"Content-Type: application/octet-stream\" \\\n    \"${{\
        \ needs.release_info.outputs.release-asset-upload-url }}?name=$(basename $WHL)\"\
        \ \\\n    --data-binary \"@$WHL\";\n"
    timeout-minutes: 90
  publish:
    env:
      MODE: debug
    if: github.repository_owner == 'pantsbuild' && needs.release_info.outputs.is-release
      == 'true'
    needs:
    - build_wheels_linux_x86_64
    - build_wheels_linux_arm64
    - build_wheels_macos10_15_x86_64
    - build_wheels_macos11_arm64
    - release_info
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Pants at Release Tag
      uses: actions/checkout@v3
      with:
        fetch-depth: '0'
        fetch-tags: true
        ref: ${{ needs.release_info.outputs.build-ref }}
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: '3.9'
    - name: Expose Pythons
      uses: pantsbuild/actions/expose-pythons@627a8ce25d972afa03da1641be9261bbbe0e3ffe
    - name: Install Protoc
      uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        version: 23.x
    - name: Set rustup profile
      run: rustup set profile default
    - name: Cache Rust toolchain
      uses: actions/cache@v3
      with:
        key: Linux-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
        path: '~/.rustup/toolchains/1.78.0-*

          ~/.rustup/update-hashes

          ~/.rustup/settings.toml

          '
    - name: Cache Cargo
      uses: benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1
      with:
        cache-bin: 'false'
        shared-key: engine
        workspaces: src/rust/engine
    - id: get-engine-hash
      name: Get native engine hash
      run: echo "hash=$(./build-support/bin/rust/print_engine_hash.sh)" >> $GITHUB_OUTPUT
      shell: bash
    - name: Cache native engine
      uses: actions/cache@v3
      with:
        key: Linux-x86_64-engine-${{ steps.get-engine-hash.outputs.hash }}-v1
        path: 'src/python/pants/bin/native_client

          src/python/pants/engine/internals/native_engine.so

          src/python/pants/engine/internals/native_engine.so.metadata'
    - name: Generate announcement
      run: './pants run src/python/pants_release/generate_release_announcement.py                         --
        --output-dir=${{ runner.temp }}

        '
    - env:
        SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
      name: Announce to Slack
      uses: slackapi/slack-github-action@v1.24.0
      with:
        channel-id: C18RRR4JK
        payload-file-path: ${{ runner.temp }}/slack_announcement.json
    - name: Announce to pants-devel
      uses: dawidd6/action-send-mail@v3.8.0
      with:
        body: file://${{ runner.temp }}/email_announcement_body.md
        connection_url: ${{ secrets.EMAIL_CONNECTION_URL }}
        convert_markdown: true
        from: Pants Announce
        secure: true
        subject: file://${{ runner.temp }}/email_announcement_subject.txt
        to: pants-devel@googlegroups.com
    - env:
        GH_REPO: ${{ github.repository }}
        GH_TOKEN: ${{ github.token }}
      name: Get release notes
      run: './pants run src/python/pants_release/changelog.py -- "${{ needs.release_info.outputs.build-ref
        }}" > notes.txt

        '
    - env:
        GH_REPO: ${{ github.repository }}
        GH_TOKEN: ${{ github.token }}
      name: Publish GitHub Release
      run: 'gh release edit ${{ needs.release_info.outputs.build-ref }} --draft=false
        --notes-file notes.txt

        '
    - env:
        GH_TOKEN: ${{ secrets.WORKER_PANTS_CHEESESHOP_TRIGGER_PAT }}
      name: Trigger cheeseshop build
      run: 'gh api -X POST "/repos/pantsbuild/wheels.pantsbuild.org/dispatches" -F
        event_type=github-pages

        '
    - env:
        GH_TOKEN: ${{ secrets.WORKER_PANTS_PANTSBUILD_ORG_TRIGGER_PAT }}
      if: needs.release_info.outputs.is-release == 'true'
      name: Trigger docs sync
      run: 'RELEASE_TAG=${{ needs.release_info.outputs.build-ref }}

        RELEASE_VERSION="${RELEASE_TAG#release_}"

        gh workflow run sync_docs.yml -F "version=$RELEASE_VERSION" -F "reviewer=${{
        github.actor }}" -R pantsbuild/pantsbuild.org

        '
  release_info:
    if: github.repository_owner == 'pantsbuild'
    name: Create draft release and output info
    outputs:
      build-ref: ${{ steps.get_info.outputs.build-ref }}
      is-release: ${{ steps.get_info.outputs.is-release }}
      release-asset-upload-url: ${{ steps.make_draft_release.outputs.release-asset-upload-url
        }}
    runs-on: ubuntu-latest
    steps:
    - env:
        REF: ${{ github.event.inputs.ref }}
      id: get_info
      name: Determine ref to build
      run: "if [[ -n \"$REF\" ]]; then\n    ref=\"$REF\"\nelse\n    ref=\"${GITHUB_REF#refs/tags/}\"\
        \nfi\necho \"build-ref=${ref}\" >> $GITHUB_OUTPUT\nif [[ \"${ref}\" =~ ^release_.+$\
        \ ]]; then\n    echo \"is-release=true\" >> $GITHUB_OUTPUT\nfi\n"
    - env:
        GH_REPO: ${{ github.repository }}
        GH_TOKEN: ${{ github.token }}
      id: make_draft_release
      if: github.repository_owner == 'pantsbuild' && steps.get_info.outputs.is-release
        == 'true'
      name: Make GitHub Release
      run: "RELEASE_TAG=${{ steps.get_info.outputs.build-ref }}\nRELEASE_VERSION=\"\
        ${RELEASE_TAG#release_}\"\n\n# NB: This could be a re-run of a release, in\
        \ the event a job/step failed.\nif ! gh release view $RELEASE_TAG ; then\n\
        \    GH_RELEASE_ARGS=(\"--notes\" \"\")\n    GH_RELEASE_ARGS+=(\"--title\"\
        \ \"$RELEASE_TAG\")\n    if [[ $RELEASE_VERSION =~ [[:alpha:]] ]]; then\n\
        \        GH_RELEASE_ARGS+=(\"--prerelease\")\n        GH_RELEASE_ARGS+=(\"\
        --latest=false\")\n    else\n        STABLE_RELEASE_TAGS=$(gh api -X GET -F\
        \ per_page=100 /repos/{owner}/{repo}/releases --jq '.[].tag_name | sub(\"\
        ^release_\"; \"\") | select(test(\"^[0-9.]+$\"))')\n        LATEST_TAG=$(echo\
        \ \"$STABLE_RELEASE_TAGS $RELEASE_TAG\" | tr ' ' '\\n' | sort --version-sort\
        \ | tail -n 1)\n        if [[ $RELEASE_TAG == $LATEST_TAG ]]; then\n     \
        \       GH_RELEASE_ARGS+=(\"--latest=true\")\n        else\n            GH_RELEASE_ARGS+=(\"\
        --latest=false\")\n        fi\n    fi\n\n    gh release create \"$RELEASE_TAG\"\
        \ \"${GH_RELEASE_ARGS[@]}\" --draft\nfi\n\nASSET_UPLOAD_URL=$(gh release view\
        \ \"$RELEASE_TAG\" --json uploadUrl --jq '.uploadUrl | sub(\"\\\\{\\\\?.*$\"\
        ; \"\")')\necho \"release-asset-upload-url=$ASSET_UPLOAD_URL\" >> $GITHUB_OUTPUT\n"
name: Release
'on':
  push:
    tags:
    - release_*
  workflow_dispatch:
    inputs:
      ref:
        required: true
        type: string


Auto Cherry-Picker

name: Auto Cherry-Picker

on:
  # NB: This is safe since we already have merged the PR.
  # See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
  pull_request_target:
    types: [closed]
    branches: [main]
  workflow_dispatch:
    inputs:
      PR_number:
        description: The PR number to cherry-pick
        type: string
        required: true

jobs:
  prerequisites:
    name: Gather Prerequisites
    if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'needs-cherrypick') )
    runs-on: ubuntu-latest
    outputs:
      pr_num: ${{ steps.get-prereqs.outputs.pr_num }}
      merge_commit: ${{ steps.get-prereqs.outputs.merge_commit }}
      matrix: ${{ steps.get-prereqs.outputs.matrix }}
    steps:
      - uses: actions/setup-node@v3
        with:
          node-version: 16
      - name: Check out code
        uses: actions/checkout@v3
      - run: npm install ./build-support/cherry_pick
      - id: get-prereqs
        name: Get Cherry-Pick prerequisites
        uses: actions/github-script@v6
        with:
          github-token: ${{ secrets.WORKER_PANTS_CHERRY_PICK_PAT }}
          script: |
            const Helper = require('./build-support/cherry_pick/helper.js');
            const helper = new Helper({octokit: github, context, core});
            const prereqs = await helper.get_prereqs();

            if (prereqs !== null) {
              core.setOutput("pr_num", prereqs.pr_num);
              core.setOutput("merge_commit", prereqs.merge_commit);
              core.setOutput("matrix", prereqs.milestones.map(
                milestone => {return {
                  milestone,
                  branch_name: `cherry-pick-${prereqs.pr_num}-to-${milestone}`,
                }}
              ));
            }

  cherry_picker:
    name: Cherry-Pick
    needs: prerequisites
    runs-on: ubuntu-latest
    continue-on-error: true # Don't cancel other jobs if this one fails
    strategy:
      matrix:
        include: ${{ fromJSON(needs.prerequisites.outputs.matrix) }}
    steps:
      - name: Check out code
        uses: actions/checkout@v3
        with:
          token: ${{ secrets.WORKER_PANTS_CHERRY_PICK_PAT }}
      - name: Prepare cherry-pick branch
        if: ${{ !env.ACT }}
        run: |
          git config --local user.email "pantsbuild+github-automation@gmail.com"
          git config --local user.name "Worker Pants (Pantsbuild GitHub Automation Bot)"

          git fetch --depth=2 origin "${{ needs.prerequisites.outputs.merge_commit }}"
          # NB: If this fetch fails, we assume that means the milestone branch hasn't been created yet
          git fetch --depth 1 origin "${{ matrix.milestone }}" || exit 0
          git checkout -b "${{ matrix.branch_name }}" FETCH_HEAD
          git cherry-pick "${{ needs.prerequisites.outputs.merge_commit }}"
          git push -u origin "${{ matrix.branch_name }}"

          # Now we go back to `main` to ensure we're running the latest `make_pr.sh`.
          # (this only really should matter if we're cherry-picking changed to `make_pr.sh` itself).
          git checkout main
      - name: Create Cherry-Pick Branch
        env:
          GH_TOKEN: ${{ secrets.WORKER_PANTS_CHERRY_PICK_PAT }}
        run: |
          bash build-support/cherry_pick/make_pr.sh "${{ needs.prerequisites.outputs.pr_num }}" "${{ matrix.milestone }}" "${{ matrix.branch_name }}"

  post_pick:
    name: Post-Pick Actions
    needs: [cherry_picker, prerequisites]
    runs-on: ubuntu-latest
    # NB: We don't want to run if the prerequisites job failed or was skipped
    if: needs.prerequisites.result == 'success' && (success() || failure())
    steps:
      - name: Check out code
        uses: actions/checkout@v3
      - run: npm install ./build-support/cherry_pick
      - name: Run Script
        uses: actions/github-script@v6
        with:
          github-token: ${{ secrets.WORKER_PANTS_CHERRY_PICK_PAT }}
          script: |
            const Helper = require('./build-support/cherry_pick/helper.js');
            const helper = new Helper({octokit: github, context, core});
            await helper.cherry_pick_finished("${{ needs.prerequisites.outputs.merge_commit }}", ${{ needs.prerequisites.outputs.matrix }});


Public repos tests

# GENERATED, DO NOT EDIT!
# To change, edit `src/python/pants_release/generate_github_workflows.py` and run:
#   ./pants run src/python/pants_release/generate_github_workflows.py

jobs:
  AlexTereshenkov_cheeseshop-query:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: AlexTereshenkov/cheeseshop-query
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: AlexTereshenkov/cheeseshop-query
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: '3.9'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  Ars-Linguistica_mlconjug3:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: Ars-Linguistica/mlconjug3
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: Ars-Linguistica/mlconjug3
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  OpenSaMD_OpenSaMD:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: OpenSaMD/OpenSaMD
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: OpenSaMD/OpenSaMD
    - name: Set up Python 3.9.15
      uses: actions/setup-python@v4
      with:
        python-version: 3.9.15
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  StackStorm_st2:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: StackStorm/st2
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: StackStorm/st2
        submodules: recursive
    - name: Set up Python 3.8
      uses: actions/setup-python@v4
      with:
        python-version: '3.8'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - name: Run set-up
      run: '

        sudo apt-get install gcc git make screen libffi-dev libssl-dev python3.8-dev
        libldap2-dev libsasl2-dev

        # sudo apt-get install mongodb mongodb-server

        sudo apt-get install rabbitmq-server

        '
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test st2client::` with repo-default version (baseline)
      run: ' pants test st2client::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test st2client::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test st2client::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  fucina_treb:
    env:
      GIT_COMMIT: abcdef1234567890
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: fucina/treb
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: fucina/treb
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  ghandic_jsf:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: ghandic/jsf
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: ghandic/jsf
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  komprenilo_liga:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: komprenilo/liga
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: komprenilo/liga
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: '3.9'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  lablup_backend_ai:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: lablup/backend.ai
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: lablup/backend.ai
    - name: Set up Python 3.11.4
      uses: actions/setup-python@v4
      with:
        python-version: 3.11.4
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - name: Run set-up
      run: mkdir .tmp
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: 'Run `test :: -tests/agent/docker:: -tests/client/integration:: -tests/common/redis_helper::`
        with repo-default version (baseline)'
      run: ' pants test :: -tests/agent/docker:: -tests/client/integration:: -tests/common/redis_helper::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: 'Run `test :: -tests/agent/docker:: -tests/client/integration:: -tests/common/redis_helper::`
        with ${{ github.event.inputs.pants_version }}'
      run: '${{ github.event.inputs.extra_env }} pants test :: -tests/agent/docker::
        -tests/client/integration:: -tests/common/redis_helper::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  mitodl_ol-django:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: mitodl/ol-django
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: mitodl/ol-django
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - name: Run set-up
      run: sudo apt-get install pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  mitodl_ol-infrastructure:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: mitodl/ol-infrastructure
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: mitodl/ol-infrastructure
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  naccdata_flywheel-gear-extensions:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: naccdata/flywheel-gear-extensions
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: naccdata/flywheel-gear-extensions
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: 'Run `package :: -directory_pull::` with repo-default version (baseline)'
      run: ' pants package :: -directory_pull::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: 'Run `package :: -directory_pull::` with ${{ github.event.inputs.pants_version
        }}'
      run: '${{ github.event.inputs.extra_env }} pants package :: -directory_pull::'
  pantsbuild_example-adhoc:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/example-adhoc
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/example-adhoc
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Set up Node 20
      uses: actions/setup-node@v3
      with:
        node-version: '20'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
  pantsbuild_example-codegen:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/example-codegen
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/example-codegen
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - if: runner.os == 'Linux'
      name: Download Apache `thrift` binary (Linux)
      run: 'mkdir -p "${HOME}/.thrift"

        curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift
        -o "${HOME}/.thrift/thrift"

        chmod +x "${HOME}/.thrift/thrift"

        echo "${HOME}/.thrift" >> $GITHUB_PATH

        '
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  pantsbuild_example-django:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/example-django
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/example-django
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: '3.9'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  pantsbuild_example-docker:
    env:
      DYNAMIC_TAG: dynamic-tag-here
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/example-docker
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/example-docker
    - name: Set up Python 3.8
      uses: actions/setup-python@v4
      with:
        python-version: '3.8'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  pantsbuild_example-golang:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/example-golang
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/example-golang
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Install Go
      uses: actions/setup-go@v3
      with:
        go-version: 1.19.5
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  pantsbuild_example-jvm:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/example-jvm
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/example-jvm
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  pantsbuild_example-kotlin:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/example-kotlin
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/example-kotlin
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  pantsbuild_example-python:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/example-python
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/example-python
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: '3.9'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
  pantsbuild_example-visibility:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/example-visibility
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/example-visibility
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: '3.9'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint ::` with repo-default version (baseline)
      run: ' pants lint ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
  pantsbuild_scie-pants:
    env:
      PANTS_REMOTE_CACHE_READ: 'false'
      PANTS_REMOTE_CACHE_WRITE: 'false'
    name: pantsbuild/scie-pants
    permissions: {}
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v3
      with:
        fetch-depth: 10
        repository: pantsbuild/scie-pants
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: '3.9'
    - name: Pants on
      run: '

        curl --proto ''=https'' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh
        | bash -

        echo "$HOME/bin" | tee -a $GITHUB_PATH

        '
    - name: Check for pants.ci.toml
      run: "\nif [[ -f pants.ci.toml ]]; then\n    echo \"PANTS_CONFIG_FILES=pants.ci.toml\"\
        \ | tee -a $GITHUB_ENV\nfi\n"
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `version` with repo-default version (baseline)
      run: ' pants version'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with repo-default version
        (baseline)
      run: ' pants tailor --check update-build-files --check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `lint check ::` with repo-default version (baseline)
      run: ' pants lint check ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `test ::` with repo-default version (baseline)
      run: ' pants test ::'
    - env:
        PANTS_VERSION: ''
      if: success() || failure()
      name: Run `package ::` with repo-default version (baseline)
      run: ' pants package ::'
    - if: success() || failure()
      name: Kill pantsd
      run: pkill -f pantsd
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `version` with ${{ github.event.inputs.pants_version }}
      run: ${{ github.event.inputs.extra_env }} pants version
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `tailor --check update-build-files --check ::` with ${{ github.event.inputs.pants_version
        }}
      run: '${{ github.event.inputs.extra_env }} pants tailor --check update-build-files
        --check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `lint check ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants lint check ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `test ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants test ::'
    - env:
        PANTS_VERSION: ${{ github.event.inputs.pants_version }}
      if: success() || failure()
      name: Run `package ::` with ${{ github.event.inputs.pants_version }}
      run: '${{ github.event.inputs.extra_env }} pants package ::'
name: Public repos tests
'on':
  workflow_dispatch:
    inputs:
      extra_env:
        default: ''
        description: 'Extra environment variables (for example: `PANTS_FOO_BAR=1 PANTS_BAZ_QUX=abc`)'
        required: false
        type: string
      pants_version:
        description: Pants version (for example, `2.16.0`, `2.18.0.dev1`)
        required: true
        type: string
run-name: 'Public repos test: version ${{ github.event.inputs.pants_version }} ${{
  github.event.inputs.extra_env }}'


# GENERATED, DO NOT EDIT!
# To change, edit `src/python/pants_release/generate_github_workflows.py` and run:
#   ./pants run src/python/pants_release/generate_github_workflows.py

jobs:
  clean_linux_arm64:
    runs-on:
    - self-hosted
    - Linux
    - ARM64
    steps:
    - name: df before
      run: df -h
    - name: Deleting ~/Library/Caches
      run: du -sh ~/Library/Caches || true; rm -rf ~/Library/Caches || true
    - name: Deleting ~/.cache
      run: du -sh ~/.cache || true; rm -rf ~/.cache || true
    - name: Deleting ~/.nce
      run: du -sh ~/.nce || true; rm -rf ~/.nce || true
    - name: Deleting ~/.rustup
      run: du -sh ~/.rustup || true; rm -rf ~/.rustup || true
    - name: Deleting ~/.pex
      run: du -sh ~/.pex || true; rm -rf ~/.pex || true
    - name: df after
      run: df -h
  clean_macos10_15_x86_64:
    runs-on:
    - self-hosted
    - macOS-10.15-X64
    steps:
    - name: df before
      run: df -h
    - name: Deleting ~/Library/Caches
      run: du -sh ~/Library/Caches || true; rm -rf ~/Library/Caches || true
    - name: Deleting ~/.cache
      run: du -sh ~/.cache || true; rm -rf ~/.cache || true
    - name: Deleting ~/.nce
      run: du -sh ~/.nce || true; rm -rf ~/.nce || true
    - name: Deleting ~/.rustup
      run: du -sh ~/.rustup || true; rm -rf ~/.rustup || true
    - name: Deleting ~/.pex
      run: du -sh ~/.pex || true; rm -rf ~/.pex || true
    - name: df after
      run: df -h
  clean_macos11_arm64:
    runs-on:
    - self-hosted
    - macOS-11-ARM64
    steps:
    - name: df before
      run: df -h
    - name: Deleting ~/Library/Caches
      run: du -sh ~/Library/Caches || true; rm -rf ~/Library/Caches || true
    - name: Deleting ~/.cache
      run: du -sh ~/.cache || true; rm -rf ~/.cache || true
    - name: Deleting ~/.nce
      run: du -sh ~/.nce || true; rm -rf ~/.nce || true
    - name: Deleting ~/.rustup
      run: du -sh ~/.rustup || true; rm -rf ~/.rustup || true
    - name: Deleting ~/.pex
      run: du -sh ~/.pex || true; rm -rf ~/.pex || true
    - name: df after
      run: df -h
name: Clear persistent caches on long-lived self-hosted runners
'on':
  workflow_dispatch: {}


Say Hello to First-timers

name: Say Hello to First-timers

on:
  issues:
    types: [opened]
  # NB: This is safe since we don't checkout the repo
  # See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
  pull_request_target:
    types: [opened]
    branches: [main]

jobs:
  check_for_first_interaction:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/first-interaction@v1
        with:
          repo-token: ${{ secrets.WORKER_PANTS_SAY_HI_PAT }}
          issue-message: |
            Welcome to the Pantsbuild Community. This looks like your first issue here. Thanks for taking the time to write it.

            If you haven't already, feel free to [come say hi on Slack](https://docs.google.com/forms/d/e/1FAIpQLSf9zgf-MXRnVDJbrVEST3urqneq7LCcy0zw8qU-GH4hPMn52A/viewform?usp=sf_link).

            If you have questions, or just want to surface this issue, check out the `#development` channel.
            (If you want to check it out without logging in, check out our [Linen mirror](https://chat.pantsbuild.org/))

            Thanks again, and we look forward to your next Issue/PR :smile:!

          pr-message: |
            Welcome to the Pantsbuild Community. This looks like your first PR here.

            We are so grateful for each an every contribution, big or small.
            So thanks for spending your time and energy making this project better.

            If you haven't gotten a reply in a week, feel free to gently comment "bump" to ping the project admins.

            If you haven't already, feel free to [come say hi on Slack](https://docs.google.com/forms/d/e/1FAIpQLSf9zgf-MXRnVDJbrVEST3urqneq7LCcy0zw8qU-GH4hPMn52A/viewform?usp=sf_link).

            If you have questions, or just want to surface this PR, check out the `#development` channel.
            (If you want to check it out without logging in, check out our [Linen mirror](https://chat.pantsbuild.org/))

            Thanks again for this PR, and we'll be on the lookout for your next one :smile:!


Bandit

# GitHub Actions Bandit Workflow

name: Bandit

on:
  pull_request:
    branches: [ main ]

  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      # Task will fail if any high-severity issues are found
      # Ignoring submodules
      - name: Run Bandit Security Analysis
        run: |
              python -m pip install bandit
              python -m bandit -r . -x ./third_party -lll


Build M1 Conda

name: Build M1 Conda

on:
  pull_request:
  push:
    branches:
      - nightly
      - main
      - release/*
    tags:
        # NOTE: Binary build pipelines should only get triggered on release candidate builds
        # Release candidate tags look like: v1.11.0-rc1
        - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
  cancel-in-progress: true

jobs:
  generate-matrix:
    uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
    with:
      package-type: conda
      os: macos-arm64
      test-infra-repository: pytorch/test-infra
      test-infra-ref: main
  build:
    needs: generate-matrix
    strategy:
      fail-fast: false
      matrix:
        include:
          - repository: pytorch/audio
            conda-package-directory: packaging/torchaudio
            smoke-test-script: test/smoke_test/smoke_test.py
            package-name: torchaudio
    name: ${{ matrix.repository }}
    uses: pytorch/test-infra/.github/workflows/build_conda_macos.yml@main
    with:
      conda-package-directory: packaging/torchaudio
      repository: ${{ matrix.repository }}
      ref: ""
      test-infra-repository: pytorch/test-infra
      test-infra-ref: main
      build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
      smoke-test-script: ${{ matrix.smoke-test-script }}
      runner-type: macos-m1-stable
      package-name: ${{ matrix.package-name }}
      trigger-event: ${{ github.event_name }}
    secrets:
      CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
      CONDA_PYTORCHBOT_TOKEN_TEST: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}


Build Windows Conda

name: Build Windows Conda

on:
  pull_request:
  push:
    branches:
      - nightly
      - main
      - release/*
    tags:
        # NOTE: Binary build pipelines should only get triggered on release candidate builds
        # Release candidate tags look like: v1.11.0-rc1
        - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
  workflow_dispatch:

jobs:
  generate-matrix:
    uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
    with:
      package-type: conda
      os: windows
      test-infra-repository: pytorch/test-infra
      test-infra-ref: main
  build:
    needs: generate-matrix
    strategy:
      fail-fast: false
      matrix:
        include:
          - repository: pytorch/audio
            smoke-test-script: test/smoke_test/smoke_test.py
            conda-package-directory: packaging/torchaudio
            package-name: torchaudio
    name: ${{ matrix.repository }}
    uses: pytorch/test-infra/.github/workflows/build_conda_windows.yml@main
    with:
      conda-package-directory: packaging/torchaudio
      repository: ${{ matrix.repository }}
      ref: ""
      test-infra-repository: pytorch/test-infra
      test-infra-ref: main
      build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
      package-name: ${{ matrix.package-name }}
      smoke-test-script: ${{ matrix.smoke-test-script }}
      trigger-event: ${{ github.event_name }}
    secrets:
      CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
      CONDA_PYTORCHBOT_TOKEN_TEST: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}


Build M1 Wheels

name: Build M1 Wheels

on:
  pull_request:
  push:
    branches:
      - nightly
      - main
      - release/*
    tags:
        # NOTE: Binary build pipelines should only get triggered on release candidate builds
        # Release candidate tags look like: v1.11.0-rc1
        - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
  cancel-in-progress: true

permissions:
  id-token: write
  contents: read

jobs:
  generate-matrix:
    uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
    with:
      package-type: wheel
      os: macos-arm64
      test-infra-repository: pytorch/test-infra
      test-infra-ref: main
  build:
    needs: generate-matrix
    strategy:
      fail-fast: false
      matrix:
        include:
          - repository: pytorch/audio
            smoke-test-script: test/smoke_test/smoke_test_no_ffmpeg.py
            package-name: torchaudio
    name: ${{ matrix.repository }}
    uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main
    with:
      repository: ${{ matrix.repository }}
      ref: ""
      test-infra-repository: pytorch/test-infra
      test-infra-ref: main
      build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
      smoke-test-script: ${{ matrix.smoke-test-script }}
      runner-type: macos-m1-stable
      package-name: ${{ matrix.package-name }}
      trigger-event: ${{ github.event_name }}


Build Linux Conda

name: Build Linux Conda

on:
  pull_request:
  push:
    branches:
      - nightly
      - main
      - release/*
    tags:
        # NOTE: Binary build pipelines should only get triggered on release candidate builds
        # Release candidate tags look like: v1.11.0-rc1
        - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
  cancel-in-progress: true

jobs:
  generate-matrix:
    uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
    with:
      package-type: conda
      os: linux
      test-infra-repository: pytorch/test-infra
      test-infra-ref: main
  build:
    needs: generate-matrix
    strategy:
      fail-fast: false
      matrix:
        include:
          - repository: pytorch/audio
            smoke-test-script: test/smoke_test/smoke_test.py
            conda-package-directory: packaging/torchaudio
            package-name: torchaudio
    name: ${{ matrix.repository }}
    uses: pytorch/test-infra/.github/workflows/build_conda_linux.yml@main
    with:
      conda-package-directory: packaging/torchaudio
      repository: ${{ matrix.repository }}
      ref: ""
      test-infra-repository: pytorch/test-infra
      test-infra-ref: main
      build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
      package-name: ${{ matrix.package-name }}
      smoke-test-script: ${{ matrix.smoke-test-script }}
      trigger-event: ${{ github.event_name }}
    secrets:
      CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
      CONDA_PYTORCHBOT_TOKEN_TEST: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}