Skip to content

Commit

Permalink
Update publish_package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
james03160927 authored May 9, 2024
1 parent 11d5cdc commit 39a0ec2
Showing 1 changed file with 36 additions and 17 deletions.
53 changes: 36 additions & 17 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,36 +81,43 @@ jobs:
repository: 'Comfy-Org/homebrew-comfy-cli'
token: ${{ secrets.COMMITTER_TOKEN }}
path: 'homebrew-repo'

- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Set up Python environment
run: |
python3 -m venv venv
source venv/bin/activate
pip install comfy-cli==$VERSION homebrew-pypi-poet
- name: Generate Homebrew Formula
run: |
source venv/bin/activate
poet -f comfy-cli==$VERSION > comfy-cli.rb
poet -f comfy-cli==$VERSION > comfy-cli@${{ env.VERSION }}.rb
- name: Copy Version Formula as Latest
run: cp comfy-cli@${{ env.VERSION }}.rb comfy-cli.rb

- name: Move Formulas to Tap Directory
run: |
mv comfy-cli@${{ env.VERSION }}.rb homebrew-repo/Formula/
mv comfy-cli.rb homebrew-repo/Formula/
- name: Install Comfy CLI using Homebrew Formula
run: |
brew install --build-from-source ./Formula/comfy-cli.rb
brew install --build-from-source ./homebrew-repo/Formula/comfy-cli.rb
comfy --help
brew uninstall comfy-cli
- name: Commit and Push Formula
run: |
mv comfy-cli.rb homebrew-repo/Formula/
cd homebrew-repo
git config user.name github-actions
git config user.email [email protected]
git add Formula/comfy-cli.rb
git commit -m "Update comfy-cli formula to version $VERSION"
git add Formula/comfy-cli.rb Formula/comfy-cli@${{ env.VERSION }}.rb
git commit -m "Update comfy-cli to latest and version ${VERSION}"
git push
env:
GIT_COMMITTER_NAME: github-actions
Expand All @@ -121,17 +128,29 @@ jobs:


test-homebrew-installation:
name: Test Comfy CLI Installation via homebrew
needs: publish-homebrew-tap # This job runs after build-n-publish completes successfully
name: Test Comfy CLI Installation via Homebrew
needs: publish-homebrew-tap # This job runs after publish-homebrew-tap completes successfully
runs-on: macos-latest
steps:
- name: Tap comfy-cli homebrew tap repository
- name: Tap Comfy CLI Homebrew tap repository
run: brew tap Comfy-Org/comfy-cli

- name: Install comfy-cli via homebrew
- name: Install comfy-cli latest via Homebrew
run: brew install comfy-org/comfy-cli/comfy-cli

- name: Test Comfy CLI Help

- name: Test comfy-cli latest Help
run: comfy --help

- name: Uninstall comfy-cli latest
run: brew uninstall comfy-cli

- name: Install comfy-cli versioned via Homebrew
run: brew install comfy-org/comfy-cli/comfy-cli@${{ env.VERSION }}

- name: Test comfy-cli versioned Help
run: comfy --help

- name: Uninstall comfy-cli versioned
run: brew uninstall comfy-cli@${{ env.VERSION }}


0 comments on commit 39a0ec2

Please sign in to comment.