Skip to content

Commit

Permalink
redo script
Browse files Browse the repository at this point in the history
  • Loading branch information
therealpaulgg committed Mar 27, 2024
1 parent e98a14d commit 263580e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/update-homebrew-formula.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,25 @@ jobs:

- name: Update Homebrew formula
run: |
cd software
sh ./.github/workflows/update_formula.sh
cd homebrew-tap
GITHUB_REPO="therealpaulgg/ssh-sync"
FORMULA_PATH="Formula/ssh-sync.rb"
TAP_REPO="therealpaulgg/homebrew-ssh-sync"
# Fetch the latest release data from GitHub
LATEST_RELEASE=$(curl -s "https://api.github.com/repos/$GITHUB_REPO/releases/latest")
# Extract the version and tarball URL from the release data
VERSION=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
TARBALL_URL=$(echo "$LATEST_RELEASE" | jq -r '.tarball_url')
# Download the tarball and calculate its SHA256
SHA256=$(curl -Ls $TARBALL_URL | shasum -a 256 | awk '{print $1}')
# Update the formula with the new version and sha256
sed -i "" "s|url \".*\"|url \"$TARBALL_URL\"|g" $FORMULA_PATH
sed -i "" "s|sha256 \".*\"|sha256 \"$SHA256\"|g" $FORMULA_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/update_formula.sh

This file was deleted.

0 comments on commit 263580e

Please sign in to comment.