-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,3 +84,52 @@ jobs: | |
draft: true | ||
files: | | ||
sqruff-* | ||
update-homebrew-formula: | ||
name: Update Homebrew Formula | ||
runs-on: ubuntu-latest | ||
needs: release | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Update Homebrew Formula | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config user.name "GitHub Actions" | ||
git config user.email "[email protected]" | ||
RELEASE_VERSION=${{ github.event.release.tag_name }} | ||
STRIPPED_VERSION=${RELEASE_VERSION#v} | ||
git clone https://${GITHUB_TOKEN}@github.com/quarylabs/homebrew-quary.git | ||
cd homebrew-quary | ||
sed -i "s/version \".*\"/version \"${STRIPPED_VERSION}\"/" sqruff.rb | ||
for asset in ${{ steps.upload-release-asset.outputs.browser_download_urls }}; do | ||
if [[ $asset == *"darwin-aarch64"* ]]; then | ||
DARWIN_AARCH64_URL=$asset | ||
DARWIN_AARCH64_SHA256=$(curl -sL $asset.sha256) | ||
elif [[ $asset == *"darwin-x86_64"* ]]; then | ||
DARWIN_X86_64_URL=$asset | ||
DARWIN_X86_64_SHA256=$(curl -sL $asset.sha256) | ||
elif [[ $asset == *"linux-x86_64-musl"* ]]; then | ||
LINUX_X86_64_URL=$asset | ||
LINUX_X86_64_SHA256=$(curl -sL $asset.sha256) | ||
fi | ||
done | ||
sed -i "s|url \".*\"|url \"${DARWIN_AARCH64_URL}\"|" sqruff.rb | ||
sed -i "s/sha256 \".*\"/sha256 \"${DARWIN_AARCH64_SHA256}\"/" sqruff.rb | ||
sed -i "s|url \".*\"|url \"${DARWIN_X86_64_URL}\"|" sqruff.rb | ||
sed -i "s/sha256 \".*\"/sha256 \"${DARWIN_X86_64_SHA256}\"/" sqruff.rb | ||
sed -i "s|url \".*\"|url \"${LINUX_X86_64_URL}\"|" sqruff.rb | ||
sed -i "s/sha256 \".*\"/sha256 \"${LINUX_X86_64_SHA256}\"/" sqruff.rb | ||
git add sqruff.rb | ||
git commit -m "Update Sqruff to version ${STRIPPED_VERSION}" | ||
git push | ||
gh pr create --title "Update Sqruff to version ${STRIPPED_VERSION}" --body "Automated PR to update Sqruff to version ${STRIPPED_VERSION}" --base main |