From 73f33e92cd84b21a718475c01b0d053622c66b74 Mon Sep 17 00:00:00 2001 From: electron-rare <108685187+electron-rare@users.noreply.github.com> Date: Sun, 10 May 2026 13:41:03 +0200 Subject: [PATCH] fix(ci): use branch_to_build input for checkout and artifact naming --- .github/workflows/build-wheels.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 31032cff..4d220272 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -16,7 +16,7 @@ on: default: '' concurrency: - group: build-${{ github.ref }} + group: build-${{ github.ref }}-${{ github.event.inputs.branch_to_build }} cancel-in-progress: true jobs: @@ -31,10 +31,23 @@ jobs: env: CMAKE_BUILD_PARALLEL_LEVEL: '4' steps: + - name: Determine target branch + id: branch + run: | + NAME="${{ github.event.inputs.branch_to_build }}" + if [ -z "$NAME" ]; then + NAME="${{ github.ref_name }}" + fi + # Sanitize for artifact naming (replace / with -) + SAFE_NAME=$(echo "$NAME" | tr '/' '-') + echo "name=$NAME" >> $GITHUB_OUTPUT + echo "safe_name=$SAFE_NAME" >> $GITHUB_OUTPUT + echo "Target branch: $NAME (safe: $SAFE_NAME)" + - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.event.inputs.branch_to_build || github.ref }} + ref: ${{ steps.branch.outputs.name }} submodules: recursive - name: Set up Python ${{ matrix.python }} @@ -67,7 +80,7 @@ jobs: - name: Upload wheel artifact uses: actions/upload-artifact@v4 with: - name: mlx-${{ github.ref_name }}-py${{ matrix.python }}-wheels + name: mlx-${{ steps.branch.outputs.safe_name }}-py${{ matrix.python }}-wheels path: ./wheels/*.whl retention-days: 30 if-no-files-found: error