From 39a0ec2d8e789cf7a599aaa284bdfbd0381b89f8 Mon Sep 17 00:00:00 2001 From: James Kwon <96548424+hongil0316@users.noreply.github.com> Date: Thu, 9 May 2024 10:22:43 -0400 Subject: [PATCH] Update publish_package.yml --- .github/workflows/publish_package.yml | 53 ++++++++++++++++++--------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish_package.yml b/.github/workflows/publish_package.yml index b03d970..ad3c6a0 100644 --- a/.github/workflows/publish_package.yml +++ b/.github/workflows/publish_package.yml @@ -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 github-actions@github.com - 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 @@ -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 }}