Skip to content

Commit fd106ba

Browse files
authored
Simplify PR body assignment in conda_build.yml
Refactor PR body assignment to use direct variable assignment for SHA256, removing heredoc usage.
1 parent 1b58566 commit fd106ba

1 file changed

Lines changed: 7 additions & 129 deletions

File tree

.github/workflows/conda_build.yml

Lines changed: 7 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -216,23 +216,18 @@ jobs:
216216
cd feedstock
217217
VERSION="${{ needs.wait-for-pypi.outputs.version }}"
218218
BRANCH="update-noarch-v$VERSION"
219+
SHA256="${{ needs.wait-for-pypi.outputs.sha256 }}"
219220
220-
# Define the body text in a variable to avoid YAML indentation errors
221+
# Use simple multi-line string assignment (safe in YAML)
221222
PR_BODY="🤖 Automated update to omnipkg version $VERSION (noarch build)
222-
# Use heredoc for safe multi-line string in shell
223-
PR_BODY=$(cat <<EOF
224-
🤖 Automated update to omnipkg version $VERSION (noarch build)
225223
226224
**Changes:**
227225
- ✅ Version: $VERSION
228-
- ✅ SHA256: ${{ needs.wait-for-pypi.outputs.sha256 }}
226+
- ✅ SHA256: $SHA256
229227
- ✅ Build number: 0
230228
- ✅ Architecture: noarch
231229
232230
This PR updates the recipe for conda-forge distribution."
233-
This PR updates the recipe for conda-forge distribution.
234-
EOF
235-
)
236231
237232
# Create PR
238233
PR_URL=$(gh pr create \
@@ -415,23 +410,18 @@ jobs:
415410
cd feedstock
416411
VERSION="${{ needs.wait-for-pypi.outputs.version }}"
417412
BRANCH="update-platforms-v$VERSION"
413+
SHA256="${{ needs.wait-for-pypi.outputs.sha256 }}"
418414
419-
# Define the body text in a variable to avoid YAML indentation errors
415+
# Use simple multi-line string assignment (safe in YAML)
420416
PR_BODY="🤖 Automated update to omnipkg version $VERSION (platform builds)
421-
# Use heredoc for safe multi-line string in shell
422-
PR_BODY=$(cat <<EOF
423-
🤖 Automated update to omnipkg version $VERSION (platform builds)
424417
425418
**Changes:**
426419
- ✅ Version: $VERSION
427-
- ✅ SHA256: ${{ needs.wait-for-pypi.outputs.sha256 }}
420+
- ✅ SHA256: $SHA256
428421
- ✅ Build number: 1
429422
- ✅ Architectures: linux-64, linux-aarch64, linux-ppc64le, osx-64, osx-arm64, win-64
430423
431424
This PR updates the recipe for conda-forge distribution with platform-specific builds."
432-
This PR updates the recipe for conda-forge distribution with platform-specific builds.
433-
EOF
434-
)
435425
436426
# Create PR
437427
PR_URL=$(gh pr create \
@@ -447,116 +437,4 @@ jobs:
447437
echo "pull-request-number=$PR_NUMBER" >> $GITHUB_OUTPUT
448438
else
449439
echo "⚠️ PR may already exist, checking..."
450-
PR_NUMBER=$(gh pr list --repo conda-forge/omnipkg-feedstock --head 1minds3t:$BRANCH --json number --jq '.[0].number')
451-
echo "pull-request-number=$PR_NUMBER" >> $GITHUB_OUTPUT
452-
fi
453-
454-
- name: Request re-render
455-
if: env.skip_pr != 'true' && steps.create-pr.outputs.pull-request-number != ''
456-
env:
457-
GH_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }}
458-
run: |
459-
cd feedstock
460-
PR_NUMBER="${{ steps.create-pr.outputs.pull-request-number }}"
461-
462-
echo "🔄 Requesting re-render from @conda-forge-admin..."
463-
gh pr comment $PR_NUMBER \
464-
--repo conda-forge/omnipkg-feedstock \
465-
--body "@conda-forge-admin, please rerender"
466-
467-
echo "✅ Re-render requested, waiting 10 minutes for conda-forge-admin..."
468-
sleep 600 # Wait 10 minutes for re-render
469-
470-
- name: Wait for checks to pass
471-
if: env.skip_pr != 'true' && steps.create-pr.outputs.pull-request-number != ''
472-
env:
473-
GH_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }}
474-
run: |
475-
PR_NUMBER="${{ steps.create-pr.outputs.pull-request-number }}"
476-
477-
echo "⏳ Waiting for CI checks to complete (platforms take ~30 min)..."
478-
echo "⏰ Waiting additional 5 minutes for re-render to adjust builds..."
479-
sleep 300
480-
481-
# Now wait for actual checks to pass (this will take longer - 10+ checks)
482-
ATTEMPT=0
483-
MAX_ATTEMPTS=90 # 3 hours max for platform builds
484-
485-
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
486-
ATTEMPT=$((ATTEMPT + 1))
487-
488-
# Get check status
489-
STATUS=$(gh pr view $PR_NUMBER \
490-
--repo conda-forge/omnipkg-feedstock \
491-
--json statusCheckRollup \
492-
--jq '.statusCheckRollup[] | select(.conclusion != null) | .conclusion' | sort -u)
493-
494-
PENDING=$(gh pr view $PR_NUMBER \
495-
--repo conda-forge/omnipkg-feedstock \
496-
--json statusCheckRollup \
497-
--jq '.statusCheckRollup[] | select(.status == "IN_PROGRESS" or .status == "PENDING") | .name' | wc -l)
498-
499-
TOTAL=$(gh pr view $PR_NUMBER \
500-
--repo conda-forge/omnipkg-feedstock \
501-
--json statusCheckRollup \
502-
--jq '.statusCheckRollup | length')
503-
504-
echo "📊 Check status (Attempt $ATTEMPT): $((TOTAL - PENDING))/$TOTAL completed"
505-
506-
if [ "$PENDING" -eq 0 ] && [ "$TOTAL" -gt 10 ]; then
507-
if echo "$STATUS" | grep -q "FAILURE"; then
508-
echo "❌ Some checks failed"
509-
gh pr view $PR_NUMBER --repo conda-forge/omnipkg-feedstock --json statusCheckRollup
510-
exit 1
511-
elif echo "$STATUS" | grep -q "SUCCESS"; then
512-
echo "✅ All platform checks passed!"
513-
break
514-
fi
515-
fi
516-
517-
sleep 120 # Check every 2 minutes
518-
done
519-
520-
- name: Merge PR
521-
if: env.skip_pr != 'true' && steps.create-pr.outputs.pull-request-number != ''
522-
env:
523-
GH_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }}
524-
run: |
525-
PR_NUMBER="${{ steps.create-pr.outputs.pull-request-number }}"
526-
VERSION="${{ needs.wait-for-pypi.outputs.version }}"
527-
528-
echo "🎯 Merging PR #$PR_NUMBER..."
529-
gh pr merge $PR_NUMBER \
530-
--repo conda-forge/omnipkg-feedstock \
531-
--squash \
532-
--subject "Build for $VERSION (platforms)" \
533-
--body ""
534-
535-
echo "✅ Platform builds merged to conda-forge!"
536-
537-
# ═══════════════════════════════════════════════════════════════════
538-
# JOB 5: Final Summary
539-
# ═══════════════════════════════════════════════════════════════════
540-
final-summary:
541-
name: "📊 Release Summary"
542-
needs: [wait-for-pypi, update-local-metas, update-feedstock-noarch, update-feedstock-platforms]
543-
runs-on: ubuntu-latest
544-
if: always()
545-
steps:
546-
- name: Print Summary
547-
run: |
548-
echo "═══════════════════════════════════════════════════════"
549-
echo "🎉 CONDA-FORGE RELEASE COMPLETE"
550-
echo "═══════════════════════════════════════════════════════"
551-
echo ""
552-
echo "Version: ${{ needs.wait-for-pypi.outputs.version }}"
553-
echo "SHA256: ${{ needs.wait-for-pypi.outputs.sha256 }}"
554-
echo ""
555-
echo "✅ PyPI sync: ${{ needs.wait-for-pypi.result }}"
556-
echo "✅ Local meta updates: ${{ needs.update-local-metas.result }}"
557-
echo "✅ Conda-forge noarch: ${{ needs.update-feedstock-noarch.result }}"
558-
echo "✅ Conda-forge platforms: ${{ needs.update-feedstock-platforms.result }}"
559-
echo ""
560-
echo "🎯 Package now available on conda-forge!"
561-
echo "Install with: conda install -c conda-forge omnipkg"
562-
echo "═══════════════════════════════════════════════════════"
440+
PR_NUMBER=$(gh pr list --repo conda-forge/omnipkg-feedstock --head 1minds3t:$BRANCH --json number --jq '.[0].number'

0 commit comments

Comments
 (0)