From 1603fb7e83821557f4fa487ca809cdb61d8f581e Mon Sep 17 00:00:00 2001 From: Chris Saez Date: Thu, 5 Dec 2024 22:53:00 +0100 Subject: [PATCH 1/4] fix(homebrew): Fix utils path (#20) --- .github/workflows/badgetizr.yml | 2 +- utils.sh => Formula/utils.sh | 2 +- README.md | 6 +++--- badgetizr | 2 +- publish.sh | 4 +++- 5 files changed, 9 insertions(+), 7 deletions(-) rename utils.sh => Formula/utils.sh (97%) diff --git a/.github/workflows/badgetizr.yml b/.github/workflows/badgetizr.yml index b37a0ae..7dcacaf 100644 --- a/.github/workflows/badgetizr.yml +++ b/.github/workflows/badgetizr.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v3 - name: Run Badgetizr - uses: aiKrice/homebrew-badgetizr@fix/revamp_script_for_version + uses: aiKrice/homebrew-badgetizr@fix/homebrew_utils_path with: pr_id: ${{ github.event.pull_request.number }} configuration: .badgetizr.yml diff --git a/utils.sh b/Formula/utils.sh similarity index 97% rename from utils.sh rename to Formula/utils.sh index db65bbd..e77dafd 100755 --- a/utils.sh +++ b/Formula/utils.sh @@ -27,4 +27,4 @@ Options : EOF } -BADGETIZR_VERSION=1.4.0 \ No newline at end of file +BADGETIZR_VERSION="1.5.0" \ No newline at end of file diff --git a/README.md b/README.md index c69ba1a..afbde6a 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@

Badgetizr -![Static Badge](https://img.shields.io/badge/1.4.3-darkgreen?logo=homebrew&logoColor=white&label=Homebrew-tap) -[![Static Badge](https://img.shields.io/badge/1.4.2-grey?logo=github&logoColor=white&label=Github-Action&labelColor=black)](https://github.com/marketplace/actions/badgetizr) +![Static Badge](https://img.shields.io/${VERSION}-darkgreen?logo=homebrew&logoColor=white&label=Homebrew-tap) +[![Static Badge](https://img.shields.io/${VERSION}-grey?logo=github&logoColor=white&label=Github-Action&labelColor=black)](https://github.com/marketplace/actions/badgetizr) ![Static Badge](https://img.shields.io/badge/passed-darkgreen?logo=github&logoColor=white&label=Github&labelColor=black) ![Static Badge](https://img.shields.io/badge/soon-pink?logo=gitlab&logoColor=orange&label=Gitlab&labelColor=white) @@ -92,7 +92,7 @@ jobs: uses: actions/checkout@v3 - name: Run Badgetizr - uses: aiKrice/homebrew-badgetizr@1.4.1 + uses: aiKrice/homebrew-badgetizr@1.6.0 with: pr_id: ${{ github.event.pull_request.number }} configuration: .badgetizr.yml diff --git a/badgetizr b/badgetizr index 9e1c42a..37c6ddd 100755 --- a/badgetizr +++ b/badgetizr @@ -4,7 +4,7 @@ if [ -f "$(dirname "$0")/../libexec/utils.sh" ]; then UTILS_PATH="$(dirname "$0")/../libexec/utils.sh" else - UTILS_PATH="$(dirname "$0")/utils.sh" + UTILS_PATH="$(dirname "$0")/Formula/utils.sh" fi source "$UTILS_PATH" diff --git a/publish.sh b/publish.sh index ddd168e..035ba88 100755 --- a/publish.sh +++ b/publish.sh @@ -10,7 +10,7 @@ REPOSITORY="aiKrice/homebrew-badgetizr" FORMULA_PATH="Formula/badgetizr.rb" WORKFLOW_PATH=".github/workflows/badgetizr.yml" -UTILS_PATH="utils.sh" +UTILS_PATH="Formula/utils.sh" README_PATH="README.md" VERSION="$1" @@ -48,6 +48,8 @@ sed -i '' -E "s/(badge\/)[0-9]+\.[0-9]+\.[0-9]+(-darkgreen\?logo=homebrew)/\${VE sed -i '' -E "s/(badge\/)[0-9]+\.[0-9]+\.[0-9]+(-grey\?logo=github)/\${VERSION}\2/" "$README_PATH" sed -i '' "s|uses: aiKrice/homebrew-badgetizr@.*|uses: aiKrice/homebrew-badgetizr@${VERSION}|" "$WORKFLOW_PATH" "$README_PATH" +exit 0 + git add "$UTILS_PATH" "$WORKFLOW_PATH" "$README_PATH" git commit -m "Bump version to $VERSION for -v option" git push From b4ca21a172cf1ae12a5175da172908fd44b899ab Mon Sep 17 00:00:00 2001 From: Chris Saez Date: Thu, 5 Dec 2024 22:54:02 +0100 Subject: [PATCH 2/4] Bump version to 1.5.1 for -v option --- .github/workflows/badgetizr.yml | 2 +- Formula/utils.sh | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/badgetizr.yml b/.github/workflows/badgetizr.yml index 7dcacaf..28229ae 100644 --- a/.github/workflows/badgetizr.yml +++ b/.github/workflows/badgetizr.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v3 - name: Run Badgetizr - uses: aiKrice/homebrew-badgetizr@fix/homebrew_utils_path + uses: aiKrice/homebrew-badgetizr@1.5.1 with: pr_id: ${{ github.event.pull_request.number }} configuration: .badgetizr.yml diff --git a/Formula/utils.sh b/Formula/utils.sh index e77dafd..9a94db4 100755 --- a/Formula/utils.sh +++ b/Formula/utils.sh @@ -27,4 +27,4 @@ Options : EOF } -BADGETIZR_VERSION="1.5.0" \ No newline at end of file +BADGETIZR_VERSION="1.5.1" diff --git a/README.md b/README.md index afbde6a..4a1214f 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ jobs: uses: actions/checkout@v3 - name: Run Badgetizr - uses: aiKrice/homebrew-badgetizr@1.6.0 + uses: aiKrice/homebrew-badgetizr@1.5.1 with: pr_id: ${{ github.event.pull_request.number }} configuration: .badgetizr.yml From fd6e29a8df608575ba8e92e87d9d4f42e2aa58d9 Mon Sep 17 00:00:00 2001 From: Chris Saez Date: Thu, 5 Dec 2024 23:03:25 +0100 Subject: [PATCH 3/4] fix(publish): Fix publish script --- README.md | 4 ++-- publish.sh | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4a1214f..af39bd2 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@

Badgetizr -![Static Badge](https://img.shields.io/${VERSION}-darkgreen?logo=homebrew&logoColor=white&label=Homebrew-tap) -[![Static Badge](https://img.shields.io/${VERSION}-grey?logo=github&logoColor=white&label=Github-Action&labelColor=black)](https://github.com/marketplace/actions/badgetizr) +![Static Badge](https://img.shields.io/1.5.1-darkgreen?logo=homebrew&logoColor=white&label=Homebrew-tap) +[![Static Badge](https://img.shields.io/1.5.1-grey?logo=github&logoColor=white&label=Github-Action&labelColor=black)](https://github.com/marketplace/actions/badgetizr) ![Static Badge](https://img.shields.io/badge/passed-darkgreen?logo=github&logoColor=white&label=Github&labelColor=black) ![Static Badge](https://img.shields.io/badge/soon-pink?logo=gitlab&logoColor=orange&label=Gitlab&labelColor=white) diff --git a/publish.sh b/publish.sh index 035ba88..d349b0d 100755 --- a/publish.sh +++ b/publish.sh @@ -42,14 +42,17 @@ if [ -z "$GITHUB_TOKEN" ]; then exit 1 fi +git switch develop +fail_if_error "Failed to switch develop. Please stash changes." +git pull +fail_if_error "Failed to pull develop. Please stash changes." + # Changing the version for -v option sed -i '' "s|^BADGETIZR_VERSION=.*|BADGETIZR_VERSION=\"$VERSION\"|" "$UTILS_PATH" -sed -i '' -E "s/(badge\/)[0-9]+\.[0-9]+\.[0-9]+(-darkgreen\?logo=homebrew)/\${VERSION}\2/" "$README_PATH" -sed -i '' -E "s/(badge\/)[0-9]+\.[0-9]+\.[0-9]+(-grey\?logo=github)/\${VERSION}\2/" "$README_PATH" +sed -i '' -E "s/(badge\/)[0-9]+\.[0-9]+\.[0-9]+(-darkgreen\?logo=homebrew)/${VERSION}\2/" "$README_PATH" +sed -i '' -E "s/(badge\/)[0-9]+\.[0-9]+\.[0-9]+(-grey\?logo=github)/${VERSION}\2/" "$README_PATH" sed -i '' "s|uses: aiKrice/homebrew-badgetizr@.*|uses: aiKrice/homebrew-badgetizr@${VERSION}|" "$WORKFLOW_PATH" "$README_PATH" -exit 0 - git add "$UTILS_PATH" "$WORKFLOW_PATH" "$README_PATH" git commit -m "Bump version to $VERSION for -v option" git push From ab6db259be3105f752ae699ee38e1d76ff1e836f Mon Sep 17 00:00:00 2001 From: Chris Saez Date: Thu, 5 Dec 2024 23:10:49 +0100 Subject: [PATCH 4/4] Bump version to 1.5.2 for -v option --- .github/workflows/badgetizr.yml | 2 +- Formula/utils.sh | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/badgetizr.yml b/.github/workflows/badgetizr.yml index 28229ae..44e4af3 100644 --- a/.github/workflows/badgetizr.yml +++ b/.github/workflows/badgetizr.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v3 - name: Run Badgetizr - uses: aiKrice/homebrew-badgetizr@1.5.1 + uses: aiKrice/homebrew-badgetizr@1.5.2 with: pr_id: ${{ github.event.pull_request.number }} configuration: .badgetizr.yml diff --git a/Formula/utils.sh b/Formula/utils.sh index 9a94db4..7aed281 100755 --- a/Formula/utils.sh +++ b/Formula/utils.sh @@ -27,4 +27,4 @@ Options : EOF } -BADGETIZR_VERSION="1.5.1" +BADGETIZR_VERSION="1.5.2" diff --git a/README.md b/README.md index af39bd2..32775f6 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ jobs: uses: actions/checkout@v3 - name: Run Badgetizr - uses: aiKrice/homebrew-badgetizr@1.5.1 + uses: aiKrice/homebrew-badgetizr@1.5.2 with: pr_id: ${{ github.event.pull_request.number }} configuration: .badgetizr.yml