From a4ef9578e029760d16f2813a0625e0e0c7c71282 Mon Sep 17 00:00:00 2001 From: Louis Beaumont Date: Wed, 31 Jul 2024 10:19:19 +0200 Subject: [PATCH] fix: ci --- .github/workflows/release-cli.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 52ee0e29..c966c0f8 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -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