Skip to content

Commit 39a0ec2

Browse files
authored
Update publish_package.yml
1 parent 11d5cdc commit 39a0ec2

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

.github/workflows/publish_package.yml

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,36 +81,43 @@ jobs:
8181
repository: 'Comfy-Org/homebrew-comfy-cli'
8282
token: ${{ secrets.COMMITTER_TOKEN }}
8383
path: 'homebrew-repo'
84-
84+
8585
- name: Extract version from tag
8686
id: get_version
8787
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
88-
88+
8989
- name: Set up Python environment
9090
run: |
9191
python3 -m venv venv
9292
source venv/bin/activate
9393
pip install comfy-cli==$VERSION homebrew-pypi-poet
94-
94+
9595
- name: Generate Homebrew Formula
9696
run: |
9797
source venv/bin/activate
98-
poet -f comfy-cli==$VERSION > comfy-cli.rb
99-
98+
poet -f comfy-cli==$VERSION > comfy-cli@${{ env.VERSION }}.rb
99+
100+
- name: Copy Version Formula as Latest
101+
run: cp comfy-cli@${{ env.VERSION }}.rb comfy-cli.rb
102+
103+
- name: Move Formulas to Tap Directory
104+
run: |
105+
mv comfy-cli@${{ env.VERSION }}.rb homebrew-repo/Formula/
106+
mv comfy-cli.rb homebrew-repo/Formula/
107+
100108
- name: Install Comfy CLI using Homebrew Formula
101109
run: |
102-
brew install --build-from-source ./Formula/comfy-cli.rb
110+
brew install --build-from-source ./homebrew-repo/Formula/comfy-cli.rb
103111
comfy --help
104112
brew uninstall comfy-cli
105-
113+
106114
- name: Commit and Push Formula
107115
run: |
108-
mv comfy-cli.rb homebrew-repo/Formula/
109116
cd homebrew-repo
110117
git config user.name github-actions
111118
git config user.email [email protected]
112-
git add Formula/comfy-cli.rb
113-
git commit -m "Update comfy-cli formula to version $VERSION"
119+
git add Formula/comfy-cli.rb Formula/comfy-cli@${{ env.VERSION }}.rb
120+
git commit -m "Update comfy-cli to latest and version ${VERSION}"
114121
git push
115122
env:
116123
GIT_COMMITTER_NAME: github-actions
@@ -121,17 +128,29 @@ jobs:
121128

122129

123130
test-homebrew-installation:
124-
name: Test Comfy CLI Installation via homebrew
125-
needs: publish-homebrew-tap # This job runs after build-n-publish completes successfully
131+
name: Test Comfy CLI Installation via Homebrew
132+
needs: publish-homebrew-tap # This job runs after publish-homebrew-tap completes successfully
126133
runs-on: macos-latest
127134
steps:
128-
- name: Tap comfy-cli homebrew tap repository
135+
- name: Tap Comfy CLI Homebrew tap repository
129136
run: brew tap Comfy-Org/comfy-cli
130-
131-
- name: Install comfy-cli via homebrew
137+
138+
- name: Install comfy-cli latest via Homebrew
132139
run: brew install comfy-org/comfy-cli/comfy-cli
133-
134-
- name: Test Comfy CLI Help
140+
141+
- name: Test comfy-cli latest Help
142+
run: comfy --help
143+
144+
- name: Uninstall comfy-cli latest
145+
run: brew uninstall comfy-cli
146+
147+
- name: Install comfy-cli versioned via Homebrew
148+
run: brew install comfy-org/comfy-cli/comfy-cli@${{ env.VERSION }}
149+
150+
- name: Test comfy-cli versioned Help
135151
run: comfy --help
152+
153+
- name: Uninstall comfy-cli versioned
154+
run: brew uninstall comfy-cli@${{ env.VERSION }}
136155

137156

0 commit comments

Comments
 (0)