Skip to content

Redis CE 8.0 RC1 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2025
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
72 changes: 30 additions & 42 deletions .github/workflows/build-binary-dists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,46 @@ on:
- 'configs/**'
- 'scripts/**'

pull_request_target:
pull_request:
branches: [ main ]
types: [ labeled ]
paths:
- '.github/workflows/build-binary-dists.yml'
- 'configs/**'
- 'scripts/**'

env:
REDIS_VERSION: "8.0-m04"

permissions:
id-token: write
contents: read

jobs:
set_variables:
name: Extract variables from JSON config
if: ${{ (github.event.label.name == 'build-binary-dists') || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
runs-on: ubuntu-latest
outputs:
redis_version: ${{ steps.read-attribute.outputs.redis_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- id: version
run: |
echo "json<<EOF" >> "$GITHUB_OUTPUT"
cat ./configs/redis_version.json >> "$GITHUB_OUTPUT"
echo >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"

- name: Extract redis_version
id: read-attribute
run: echo "redis_version=${{fromJson(steps.version.outputs.json).ref}}" >> "$GITHUB_OUTPUT"

build:
if: ${{ (github.event.label.name == 'build-binary-dists') || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
needs: [set_variables]
name: Build Redis CE MacOS Binary Distributions
strategy:
fail-fast: false
matrix:
os_version: # See: https://github.com/actions/runner-images/blob/main/README.md#available-images
- macos-13 # macOS 13 x86_64
Expand All @@ -40,45 +60,13 @@ jobs:

- name: Install build dependencies
run: |
export HOMEBREW_NO_AUTO_UPDATE=1
brew update
brew install coreutils
brew install make
brew install openssl
brew install llvm@18
brew install cmake
brew install gnu-sed
brew install make
brew install automake
brew install libtool

RUST_INSTALLER=rust-1.80.1-$(if [ "$(uname -m)" = "arm64" ]; then echo "aarch64"; else echo "x86_64"; fi)-apple-darwin
echo "Downloading and installing Rust standalone installer: ${RUST_INSTALLER}"
wget --quiet -O ${RUST_INSTALLER}.tar.xz https://static.rust-lang.org/dist/${RUST_INSTALLER}.tar.xz
tar -xf ${RUST_INSTALLER}.tar.xz
(cd ${RUST_INSTALLER} && sudo ./install.sh)
rm -rf ${RUST_INSTALLER}
scripts/install_deps.sh

- name: Build Redis CE
id: build
run: |
export HOMEBREW_PREFIX="$(brew --prefix)"
export BUILD_WITH_MODULES=yes
export BUILD_TLS=yes
export DISABLE_WERRORS=yes
PATH="$HOMEBREW_PREFIX/opt/libtool/libexec/gnubin:$HOMEBREW_PREFIX/opt/llvm@18/bin:$HOMEBREW_PREFIX/opt/make/libexec/gnubin:$HOMEBREW_PREFIX/opt/gnu-sed/libexec/gnubin:$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH" # Override macOS defaults.
export LDFLAGS="-L$HOMEBREW_PREFIX/opt/llvm@18/lib"
export CPPFLAGS="-I$HOMEBREW_PREFIX/opt/llvm@18/include"

curl -L "https://github.com/redis/redis/archive/refs/tags/${{ vars.BINARY_VERSION_TO_BUILD }}.tar.gz" -o redis.tar.gz
tar xzf redis.tar.gz

mkdir -p build_dir/etc
make -C redis-${{ vars.BINARY_VERSION_TO_BUILD }} -j "$(nproc)" all OS=macos
make -C redis-${{ vars.BINARY_VERSION_TO_BUILD }} install PREFIX=$(pwd)/build_dir OS=macos
cp ./configs/redis.conf build_dir/etc/redis.conf
(cd build_dir && zip -r ../redis-ce-${{ vars.BINARY_VERSION_TO_BUILD }}-$(uname -m).zip .)
echo "UNSIGNED_REDIS_BINARY=unsigned-redis-ce-${{ vars.BINARY_VERSION_TO_BUILD }}-$(uname -m).zip" >> $GITHUB_OUTPUT
scripts/build.sh ${{ needs.set_variables.outputs.redis_version }}
echo "UNSIGNED_REDIS_BINARY=unsigned-redis-ce-${{ needs.set_variables.outputs.redis_version }}-$(uname -m).zip" >> $GITHUB_OUTPUT

- name: Upload Redis CE Binary Distribution
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -133,8 +121,8 @@ jobs:
done

# Create distribution archive
(cd build_dir && zip -r ../redis-ce-${{ vars.BINARY_VERSION_TO_BUILD }}-$(uname -m).zip .)
echo "REDIS_BINARY=redis-ce-${{ vars.BINARY_VERSION_TO_BUILD }}-$(uname -m).zip" >> $GITHUB_OUTPUT
(cd build_dir && zip -r ../redis-ce-${{ needs.set_variables.outputs.redis_version }}-$(uname -m).zip .)
echo "REDIS_BINARY=redis-ce-${{ needs.set_variables.outputs.redis_version }}-$(uname -m).zip" >> $GITHUB_OUTPUT

- name: Notarize Redis CE Binary Distribution
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand All @@ -150,4 +138,4 @@ jobs:
- name: Upload Redis CE Binary Distribution to S3
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
aws s3 cp ${{ steps.sign.outputs.REDIS_BINARY }} s3://${{ secrets.S3_BUCKET }}/homebrew/ --acl public-read
aws s3 cp ${{ steps.sign.outputs.REDIS_BINARY }} s3://${{ secrets.S3_BUCKET }}/homebrew/ --acl public-read
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
paths:
- '.github/workflows/test.yml'
- 'Casks/**'
- 'configs/**'
paths-ignore:
- 'configs/redis_version.json'

jobs:
test:
Expand Down
Loading
Loading