Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aiKrice committed Dec 4, 2024
2 parents 210f95d + 2df66ff commit ce3708c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
uses: actions/checkout@v3

- name: Run Badgetizr
uses: aiKrice/homebrew-badgetizr@1.3.0
uses: aiKrice/homebrew-badgetizr@1.4.0
with:
pr_id: ${{ github.event.pull_request.number }}
configuration: .badgetizr.yml
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: 'Badgetizr'
description: 'A GitHub Action to run Badgetizr for custom PR badges'
branding:
icon: 'award'
color: 'green'
inputs:
pr_id:
description: 'Specify the path to the configuration. Default is .badgetizr.yml'
Expand Down
26 changes: 13 additions & 13 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/zsh

# The script publish.sh is usefull to:
# - Generate the sha256 for Homebrew formula
Expand All @@ -13,15 +13,15 @@ WORKFLOW_PATH=".github/workflows/badgetizr.yml"
README_PATH="README.md"
VERSION="$1"

red='\033[1;31m'
green='\033[1;32m'
yellow='\033[1;33m'
blue='\033[1;34m'
purple='\033[1;35m'
cyan='\033[1;36m'
white='\033[1;37m'
orange='\033[38;5;208m'
reset='\033[0m'
red='\e[1;31m'
green='\e[1;32m'
yellow='\e[1;33m'
blue='\e[1;34m'
purple='\e[1;35m'
cyan='\e[1;36m'
white='\e[1;37m'
orange='\e[38;5;208m'
reset='\e[0m'

function fail_if_error() {
if [ $? -ne 0 ]; then
Expand All @@ -32,7 +32,7 @@ function fail_if_error() {
}

if [ -z "$VERSION" ]; then
echo "❌ Please provide a version (example: ./release.sh ${cyan}1.1.3${reset}). Please respect the semantic versioning notation."
echo -e "❌ Please provide a ${cyan}version${reset} (example: ./release.sh ${cyan}1.1.3${reset}). Please respect the semantic versioning notation."
exit 1
fi

Expand All @@ -59,7 +59,7 @@ curl -L -o "badgetizr-$VERSION.tar.gz" "$ARCHIVE_URL" > /dev/null
fail_if_error "Failed to download the archive"
echo "🟢 [Step 3/5] Archive downloaded."
SHA256=$(shasum -a 256 "badgetizr-$VERSION.tar.gz" | awk '{print $1}')
echo "🟢 SHA256 generated: ${cyan}$SHA256${reset}"
echo -e "🟢 SHA256 generated: ${cyan}$SHA256${reset}"

# Step 3: Update the formula
sed -i "" -E \
Expand All @@ -68,7 +68,7 @@ sed -i "" -E \
"$FORMULA_PATH"

# Step 3bis: Update the workflow with new version number
sed -i '' "s|uses: aiKrice/homebrew-badgetizr@.*|uses: aiKrice/homebrew-badgetizr@${NEW_VERSION}|" "$WORKFLOW_FILE"
sed -i '' "s|uses: aiKrice/homebrew-badgetizr@.*|uses: aiKrice/homebrew-badgetizr@${NEW_VERSION}|" "$WORKFLOW_PATH"

# Step 4: Commit and push
echo "🟡 [Step 4/5] Commiting the bump of the files..."
Expand Down

0 comments on commit ce3708c

Please sign in to comment.