-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
3 changed files
with
92 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class Badgetizr < Formula | ||
desc "Badgetizr is a tool to allow custom badges automatically added and updated according the content of your pull request." | ||
homepage "https://github.com/aiKrice/homebrew-badgetizr" | ||
url "https://github.com/aiKrice/homebrew-badgetizr/archive/refs/tags/1.2.0.tar.gz" | ||
sha256 "024892da67071348af9b4bef84be76c121ab8b0779dd099ae0c8478f9aec59a3" | ||
license "MIT" | ||
|
||
depends_on "yq" | ||
depends_on "gh" | ||
|
||
def install | ||
bin.install "badgetizr.sh" => "badgetizr" | ||
end | ||
|
||
end | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# The script deploy-homebrew.sh is used to release the tool to the homebrew repository. | ||
# It will create a tag, update the formula and create a PR. | ||
|
||
# Configuration | ||
REPOSITORY="aiKrice/homebrew-badgetizr" | ||
FORMULA_PATH="Formula/badgetizr.rb" | ||
VERSION="$1" | ||
|
||
if [ -z "$VERSION" ]; then | ||
echo "❌ Please provide a version (example: ./release.sh 1.1.3). Please respect the semantic versioning notation." | ||
exit 1 | ||
fi | ||
|
||
# Step 1: Create the release | ||
git switch master | ||
git pull | ||
git merge develop --no-ff --no-edit --no-verify | ||
echo "🟢 Develop merged into master" | ||
git push --no-verify | ||
|
||
echo "🟡 Creating the release tag" | ||
git tag -a "$VERSION" -m "Release $VERSION" | ||
git push origin "$VERSION" --no-verify | ||
gh release create $VERSION --generate-notes --verify-tag | ||
echo "🟢 Github release created" | ||
|
||
# Step 2: Download the archive and calculate SHA256 for Homebrew | ||
ARCHIVE_URL="https://github.com/$REPOSITORY/archive/refs/tags/$VERSION.tar.gz" | ||
curl -L -o "badgetizr-$VERSION.tar.gz" "$ARCHIVE_URL" | ||
SHA256=$(shasum -a 256 "badgetizr-$VERSION.tar.gz" | awk '{print $1}') | ||
echo "🟢 SHA256 generated: $SHA256" | ||
|
||
# Step 3: Update the formula | ||
sed -i "" -E \ | ||
-e "s#(url \").*(\".*)#\1$ARCHIVE_URL\2#" \ | ||
-e "s#(sha256 \").*(\".*)#\1$SHA256\2#" \ | ||
"$FORMULA_PATH" | ||
|
||
# Step 4: Commit and push | ||
git add "$FORMULA_PATH" | ||
git commit -m "Update formula for version $VERSION" | ||
git push --no-verify | ||
|
||
# Step 5: Backmerge to develop | ||
git switch develop | ||
git pull | ||
git merge master --no-ff --no-edit --no-verify | ||
git push --no-verify | ||
echo "🟢 Backmerged to develop" | ||
|
||
echo "🚀 Done" |