Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .github/actions/bump-redis-version/action.yml

This file was deleted.

96 changes: 0 additions & 96 deletions .github/actions/bump-redis-version/bump-redis-version.sh

This file was deleted.

19 changes: 14 additions & 5 deletions .github/actions/common/edit-cask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ TAG=""
TAP="redis/redis"
ACTION=""

# Detect OS for sed compatibility
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS requires empty string for in-place editing
SED_INPLACE="sed -i ''"
else
# Linux doesn't need the empty string
SED_INPLACE="sed -i"
fi

# Function to display usage
usage() {
echo "Usage: $0 --cask <cask_name> --action <action> [--binary <binary_path>] [--package-json <json>] [--tap <tap_name>] <TAG>"
Expand Down Expand Up @@ -53,9 +62,9 @@ edit_cask_file(){
fi

# Change url to file://
sed -i '' "s|url \".*\"|url \"file://$binary_path\"|" $casks_path
$SED_INPLACE "s|url \".*\"|url \"file://$binary_path\"|" $casks_path
# Remove sha256 verification since it's testing
sed -i '' '/sha256 arm:/,/intel:.*"$/d' $casks_path
$SED_INPLACE '/sha256 arm:/,/intel:.*"$/d' $casks_path

elif [ "$action" = "publish" ]; then
casks_path="$(pwd)/Casks/${cask_name}.rb"
Expand All @@ -75,8 +84,8 @@ edit_cask_file(){
# Update sha256 values in cask file
if [ -n "$arm_sha" ] && [ -n "$intel_sha" ]; then
# Replace existing sha256 line with new values
sed -i "s/sha256 arm: \"[^\"]*\",$/sha256 arm: \"$arm_sha\",/" $casks_path
sed -i "/sha256 arm:/,/intel:/ s/intel: \"[^\"]*\"/intel: \"$intel_sha\"/" "$casks_path"
$SED_INPLACE "s/sha256 arm: \"[^\"]*\",$/sha256 arm: \"$arm_sha\",/" $casks_path
$SED_INPLACE "/sha256 arm:/,/intel:/ s/intel: \"[^\"]*\"/intel: \"$intel_sha\"/" "$casks_path"
else
echo "Error: Missing sha256 values in package_json"
exit 1
Expand All @@ -88,7 +97,7 @@ edit_cask_file(){
fi

# Change version
sed -i "s/version \"[^\"]*\"/version \"$tag\"/" $casks_path
$SED_INPLACE "s/version \"[^\"]*\"/version \"$tag\"/" $casks_path
}

# Parse command line arguments
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/upload-packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ runs:
for dir in redis-oss-*; do
arch=$(echo $dir | sed -E 's/.*-([^-]+)\.zip$/\1/')
sha256=$(shasum -a 256 $dir/*.zip | awk '{print $1}')

# Only copy if binary doesn't exist
aws s3api head-object --bucket ${{ inputs.BREW_S3_BUCKET }} --key homebrew/$dir >/dev/null 2>&1 || \
aws s3 cp $dir/*.zip s3://${{ inputs.BREW_S3_BUCKET }}/homebrew/ --acl public-read

# build json structure incrementally with arch and sha256
# Build json structure incrementally with arch and sha256
packages_sha256_json=$(echo "$packages_sha256_json" | jq --arg arch "$arch" --arg sha256 "$sha256" \
'.[$arch] = {"sha256": $sha256}')
done
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/release_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ jobs:
allow_modify: true
gh_token: ${{ secrets.GITHUB_TOKEN }}

- name: Bump redis version
id: bump-version
uses: ./.github/actions/bump-redis-version
with:
release_tag: ${{ github.event.inputs.release_tag }}
release_version_branch: ${{ steps.ensure-branch.outputs.release_version_branch }}
release_type: ${{ github.event.inputs.release_type }}

build-n-test:
needs: prepare-release
uses: ./.github/workflows/build-n-test.yml
Expand Down Expand Up @@ -87,6 +79,9 @@ jobs:
runs-on: ubuntu-latest
if: failure()
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Detect env name
id: detect-env
run: |
Expand Down
Loading