|
1 | | -name: Publish and Update Formula |
| 1 | +name: Publish to PyPI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | release: |
|
79 | 79 |
|
80 | 80 | - name: Test Comfy CLI Help |
81 | 81 | run: comfy --help |
82 | | - |
83 | | - publish-homebrew-tap: |
84 | | - runs-on: macos-latest # Use macOS runner where Homebrew is pre-installed |
85 | | - needs: build-n-publish-pypi |
86 | | - steps: |
87 | | - - name: Checkout code |
88 | | - uses: actions/checkout@v6 |
89 | | - with: |
90 | | - repository: 'Comfy-Org/homebrew-comfy-cli' |
91 | | - token: ${{ secrets.COMMITTER_TOKEN }} |
92 | | - path: 'homebrew-repo' |
93 | | - |
94 | | - - name: Extract version from tag |
95 | | - id: get_version |
96 | | - run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
97 | | - |
98 | | - - name: Set up Python environment |
99 | | - run: | |
100 | | - python3 -m venv venv |
101 | | - source venv/bin/activate |
102 | | - pip install homebrew-pypi-poet |
103 | | -
|
104 | | - for i in {1..3}; do |
105 | | - pip install comfy-cli==${{env.VERSION}} && break || sleep 5 |
106 | | - done |
107 | | -
|
108 | | - - name: Generate Homebrew Formula |
109 | | - run: | |
110 | | - source venv/bin/activate |
111 | | - poet -f comfy-cli==$VERSION > comfy-cli.rb |
112 | | -
|
113 | | - - name: Move Formulas to Tap Directory |
114 | | - run: | |
115 | | - mv comfy-cli.rb homebrew-repo/Formula/ |
116 | | -
|
117 | | - - name: Install Comfy CLI using Homebrew Formula |
118 | | - run: | |
119 | | - brew install --build-from-source --verbose ./homebrew-repo/Formula/comfy-cli.rb |
120 | | - comfy --help |
121 | | - brew uninstall comfy-cli |
122 | | -
|
123 | | - - name: Commit and Push Formula |
124 | | - run: | |
125 | | - cd homebrew-repo |
126 | | - git config user.name github-actions |
127 | | - git config user.email github-actions@github.com |
128 | | - git add Formula/comfy-cli.rb |
129 | | - git commit -m "Update comfy-cli to latest and version ${VERSION}" |
130 | | - git push |
131 | | - env: |
132 | | - GIT_COMMITTER_NAME: github-actions |
133 | | - GIT_COMMITTER_EMAIL: github-actions@github.com |
134 | | - GIT_AUTHOR_NAME: github-actions |
135 | | - GIT_AUTHOR_EMAIL: github-actions@github.com |
136 | | - GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }} |
137 | | - |
138 | | - |
139 | | - test-homebrew-installation: |
140 | | - name: Test Comfy CLI Installation via Homebrew |
141 | | - needs: publish-homebrew-tap # This job runs after publish-homebrew-tap completes successfully |
142 | | - runs-on: macos-latest |
143 | | - steps: |
144 | | - - name: Tap Comfy CLI Homebrew tap repository |
145 | | - run: brew tap Comfy-Org/comfy-cli |
146 | | - |
147 | | - - name: Install comfy-cli latest via Homebrew |
148 | | - run: brew install comfy-org/comfy-cli/comfy-cli |
149 | | - |
150 | | - - name: Test comfy-cli latest Help |
151 | | - run: comfy --help |
152 | | - |
153 | | - - name: Uninstall comfy-cli latest |
154 | | - run: brew uninstall comfy-cli |
0 commit comments