ci: build slim packages on macos arm64

This commit is contained in:
Ivan Dyachkov 2022-11-20 14:29:28 +01:00
parent 8355d7afa3
commit 8d138d2525
2 changed files with 20 additions and 13 deletions

View File

@ -30,25 +30,29 @@ runs:
shell: bash shell: bash
run: | run: |
brew update brew update
brew install curl zip unzip kerl coreutils openssl@1.1 brew install curl zip unzip coreutils openssl@1.1
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
echo "/usr/local/bin" >> $GITHUB_PATH echo "/usr/local/bin" >> $GITHUB_PATH
echo "OTP_SOURCE_PATH=$HOME/otp-${{ inputs.otp }}" >> $GITHUB_ENV
echo "OTP_INSTALL_PATH=/opt/erlang/${{ inputs.otp }}" >> $GITHUB_ENV
- uses: actions/cache@v3 - uses: actions/cache@v3
id: cache id: cache
with: with:
path: ~/.kerl/${{ inputs.otp }} path: /opt/erlang/${{ inputs.otp }}
key: otp-install-${{ inputs.otp }}-${{ inputs.os }}-static-ssl-disable-hipe-disable-jit key: otp-install-${{ inputs.otp }}-${{ inputs.os }}-static-ssl-disable-hipe-disable-jit
- name: build erlang - name: build erlang
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
shell: bash shell: bash
env:
KERL_BUILD_BACKEND: git
OTP_GITHUB_URL: https://github.com/emqx/otp
KERL_CONFIGURE_OPTIONS: --disable-dynamic-ssl-lib --with-ssl=/usr/local/opt/openssl@1.1 --disable-hipe --disable-jit
run: | run: |
kerl update releases if [ -d "$OTP_SOURCE_PATH" ]; then
kerl build ${{ inputs.otp }} rm -rf "$OTP_SOURCE_PATH"
kerl install ${{ inputs.otp }} $HOME/.kerl/${{ inputs.otp }} fi
git clone --depth 1 --branch OTP-${{ inputs.otp }} https://github.com/emqx/otp.git "$OTP_SOURCE_PATH"
cd "$OTP_SOURCE_PATH"
./configure --disable-dynamic-ssl-lib --with-ssl=$(brew --prefix openssl@1.1) --disable-hipe --disable-jit --prefix="$OTP_INSTALL_PATH"
make -j$(nproc)
rm -rf "$OTP_INSTALL_PATH"
make install
- name: build ${{ inputs.profile }} - name: build ${{ inputs.profile }}
env: env:
AUTO_INSTALL_BUILD_DEPS: 1 AUTO_INSTALL_BUILD_DEPS: 1
@ -61,13 +65,16 @@ runs:
APPLE_DEVELOPER_ID_BUNDLE_PASSWORD: ${{ inputs.apple_developer_id_bundle_password }} APPLE_DEVELOPER_ID_BUNDLE_PASSWORD: ${{ inputs.apple_developer_id_bundle_password }}
shell: bash shell: bash
run: | run: |
. $HOME/.kerl/${{ inputs.otp }}/activate export PATH="$OTP_INSTALL_PATH/bin:$PATH"
make ensure-rebar3 make ensure-rebar3
sudo cp rebar3 /usr/local/bin/rebar3 mkdir -p $HOME/bin
cp rebar3 $HOME/bin/rebar3
export PATH="$HOME/bin:$PATH"
make ${{ inputs.profile }}-tgz make ${{ inputs.profile }}-tgz
- name: test ${{ inputs.profile }} - name: test ${{ inputs.profile }}
shell: bash shell: bash
run: | run: |
export PATH="$OTP_INSTALL_PATH/bin:$PATH"
pkg_name=$(find _packages/${{ inputs.profile }} -mindepth 1 -maxdepth 1 -iname \*.zip) pkg_name=$(find _packages/${{ inputs.profile }} -mindepth 1 -maxdepth 1 -iname \*.zip)
mkdir emqx mkdir emqx
unzip -d emqx $pkg_name > /dev/null unzip -d emqx $pkg_name > /dev/null

View File

@ -135,6 +135,7 @@ jobs:
- 24.3.4.2-1 - 24.3.4.2-1
os: os:
- macos-11 - macos-11
- macos-12-arm64
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -143,7 +144,6 @@ jobs:
- name: prepare - name: prepare
run: | run: |
echo "EMQX_NAME=${{ matrix.profile }}" >> $GITHUB_ENV echo "EMQX_NAME=${{ matrix.profile }}" >> $GITHUB_ENV
echo "BUILD_WITH_QUIC=1" >> $GITHUB_ENV
- uses: ./.github/actions/package-macos - uses: ./.github/actions/package-macos
with: with:
profile: ${{ matrix.profile }} profile: ${{ matrix.profile }}
@ -155,7 +155,7 @@ jobs:
apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }} apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: macos name: ${{ matrix.os }}
path: _packages/**/* path: _packages/**/*
spellcheck: spellcheck: