|
| 1 | +name: "CI: Update CI Container" |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + version: |
| 9 | + description: 'ComfyUI version (e.g., v0.7.0)' |
| 10 | + required: true |
| 11 | + type: string |
| 12 | + |
| 13 | +jobs: |
| 14 | + update-ci-container: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + # Skip pre-releases unless manually triggered |
| 17 | + if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease |
| 18 | + steps: |
| 19 | + - name: Get version |
| 20 | + id: version |
| 21 | + run: | |
| 22 | + if [ "${{ github.event_name }}" = "release" ]; then |
| 23 | + VERSION="${{ github.event.release.tag_name }}" |
| 24 | + else |
| 25 | + VERSION="${{ inputs.version }}" |
| 26 | + fi |
| 27 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 28 | +
|
| 29 | + - name: Checkout comfyui-ci-container |
| 30 | + uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + repository: comfy-org/comfyui-ci-container |
| 33 | + token: ${{ secrets.CI_CONTAINER_PAT }} |
| 34 | + |
| 35 | + - name: Check current version |
| 36 | + id: current |
| 37 | + run: | |
| 38 | + CURRENT=$(grep -oP 'ARG COMFYUI_VERSION=\K.*' Dockerfile || echo "unknown") |
| 39 | + echo "current_version=$CURRENT" >> $GITHUB_OUTPUT |
| 40 | +
|
| 41 | + - name: Update Dockerfile |
| 42 | + run: | |
| 43 | + VERSION="${{ steps.version.outputs.version }}" |
| 44 | + sed -i "s/^ARG COMFYUI_VERSION=.*/ARG COMFYUI_VERSION=${VERSION}/" Dockerfile |
| 45 | +
|
| 46 | + - name: Create Pull Request |
| 47 | + id: create-pr |
| 48 | + uses: peter-evans/create-pull-request@v7 |
| 49 | + with: |
| 50 | + token: ${{ secrets.CI_CONTAINER_PAT }} |
| 51 | + branch: automation/comfyui-${{ steps.version.outputs.version }} |
| 52 | + title: "chore: bump ComfyUI to ${{ steps.version.outputs.version }}" |
| 53 | + body: | |
| 54 | + Updates ComfyUI version from `${{ steps.current.outputs.current_version }}` to `${{ steps.version.outputs.version }}` |
| 55 | +
|
| 56 | + **Triggered by:** ${{ github.event_name == 'release' && format('[Release {0}]({1})', github.event.release.tag_name, github.event.release.html_url) || 'Manual workflow dispatch' }} |
| 57 | +
|
| 58 | + labels: automation |
| 59 | + commit-message: "chore: bump ComfyUI to ${{ steps.version.outputs.version }}" |
0 commit comments