Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Jul 31, 2024
1 parent ae058a3 commit a4ef957
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,28 @@ jobs:
- name: Update Homebrew Formula
run: |
export VERSION=${{ env.VERSION }}
sed 's/version ".*"/version "'$VERSION'"/' Formula/screenpipe.rb > Formula/screenpipe.tmp && mv Formula/screenpipe.tmp Formula/screenpipe.rb
git config user.name "GitHub Actions Bot"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git fetch origin main
git checkout -b update-formula-${{ matrix.target }}
git merge origin/main --no-edit
sed -i '' 's/version ".*"/version "'$VERSION'"/' Formula/screenpipe.rb
if [ "${{ matrix.target }}" = "x86_64-apple-darwin" ]; then
sed 's/sha256 ".*" # x86_64/sha256 "'${{ env.MAC_SHA256_x86_64-apple-darwin }}'" # x86_64/' Formula/screenpipe.rb > Formula/screenpipe.tmp && mv Formula/screenpipe.tmp Formula/screenpipe.rb
sed -i '' 's/sha256 ".*" # x86_64/sha256 "'${{ env.MAC_SHA256_x86_64-apple-darwin }}'" # x86_64/' Formula/screenpipe.rb
else
sed 's/sha256 ".*" # arm64/sha256 "'${{ env.MAC_SHA256_aarch64-apple-darwin }}'" # arm64/' Formula/screenpipe.rb > Formula/screenpipe.tmp && mv Formula/screenpipe.tmp Formula/screenpipe.rb
sed -i '' 's/sha256 ".*" # arm64/sha256 "'${{ env.MAC_SHA256_aarch64-apple-darwin }}'" # arm64/' Formula/screenpipe.rb
fi
sed 's|v[0-9.]*\/screenpipe-[0-9.]*-${{ matrix.target }}|v'$VERSION'\/screenpipe-'$VERSION'-${{ matrix.target }}|' Formula/screenpipe.rb > Formula/screenpipe.tmp && mv Formula/screenpipe.tmp Formula/screenpipe.rb
sed -i '' 's|v[0-9.]*\/screenpipe-[0-9.]*-${{ matrix.target }}|v'$VERSION'\/screenpipe-'$VERSION'-${{ matrix.target }}|' Formula/screenpipe.rb
git add Formula/screenpipe.rb
git commit -m "chore: update brew to version ${{ env.VERSION }} for ${{ matrix.target }}"
git push -u origin update-formula-${{ matrix.target }}
- name: Commit and push Homebrew Formula changes
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.PAT }}
run: |
git config user.name "GitHub Actions Bot"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git stash
git pull origin main
git stash pop
git add Formula/screenpipe.rb
git commit -m "chore: update brew to version ${{ env.VERSION }} for ${{ matrix.target }}"
git push
gh pr create --base main --head update-formula-${{ matrix.target }} --title "Update Homebrew formula for ${{ matrix.target }}" --body "Automated PR to update Homebrew formula for ${{ matrix.target }}"
- name: Upload Artifact
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit a4ef957

Please sign in to comment.