From f091858a27d30367432e1e3f6acc703ac7c650c8 Mon Sep 17 00:00:00 2001 From: zhanghongtong Date: Sun, 26 Sep 2021 10:16:23 +0800 Subject: [PATCH] chore(CI): add macos 11 for build workflows Signed-off-by: zhanghongtong --- .github/workflows/build_packages.yaml | 20 ++++++++++---------- .github/workflows/build_slim_packages.yaml | 19 ++++++++++--------- build | 4 +++- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_packages.yaml b/.github/workflows/build_packages.yaml index 322d38206..5ef58f411 100644 --- a/.github/workflows/build_packages.yaml +++ b/.github/workflows/build_packages.yaml @@ -140,7 +140,6 @@ jobs: path: source/_packages/${{ matrix.profile }}/. mac: - runs-on: macos-10.15 needs: prepare @@ -148,11 +147,16 @@ jobs: fail-fast: false matrix: profile: ${{fromJSON(needs.prepare.outputs.profiles)}} + macos: + - macos-11 + - macos-10.15 otp: - 24.0.5-emqx-1 exclude: - profile: emqx-edge + runs-on: ${{ matrix.macos }} + steps: - uses: actions/download-artifact@v2 with: @@ -170,16 +174,12 @@ jobs: id: cache with: path: ~/.kerl - key: erl${{ matrix.otp }}-macos10.15 + key: otp-${{ matrix.otp }}-${{ matrix.macos }} - name: build erlang if: steps.cache.outputs.cache-hit != 'true' timeout-minutes: 60 - env: - KERL_BUILD_BACKEND: git - OTP_GITHUB_URL: https://github.com/emqx/otp run: | - kerl update releases - kerl build ${{ matrix.otp }} + kerl build git https://github.com/emqx/otp.git OTP-${{ matrix.otp }} ${{ matrix.otp }} kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }} - name: build working-directory: source @@ -191,8 +191,8 @@ jobs: - name: test working-directory: source run: | - pkg_name=$(basename _packages/${{ matrix.profile }}/${{ matrix.profile }}-*.zip) - unzip -q _packages/${{ matrix.profile }}/$pkg_name + pkg_name=$(find _packages/${{ matrix.profile }} -mindepth 1 -maxdepth 1 -iname \*.zip | head) + unzip -q $pkg_name # gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins ./emqx/bin/emqx start || cat emqx/log/erlang.log.1 ready='no' @@ -211,7 +211,7 @@ jobs: ./emqx/bin/emqx_ctl status ./emqx/bin/emqx stop rm -rf emqx - openssl dgst -sha256 ./_packages/${{ matrix.profile }}/$pkg_name | awk '{print $2}' > ./_packages/${{ matrix.profile }}/$pkg_name.sha256 + openssl dgst -sha256 $pkg_name | awk '{print $2}' > $pkg_name.sha256 - uses: actions/upload-artifact@v1 if: startsWith(github.ref, 'refs/tags/') with: diff --git a/.github/workflows/build_slim_packages.yaml b/.github/workflows/build_slim_packages.yaml index 2fb447d26..293bcb82b 100644 --- a/.github/workflows/build_slim_packages.yaml +++ b/.github/workflows/build_slim_packages.yaml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-20.04 strategy: + fail-fast: false matrix: otp: - 24.0.5-emqx-1 @@ -53,13 +54,18 @@ jobs: path: _packages/**/*.zip mac: - runs-on: macos-10.15 strategy: + fail-fast: false matrix: + macos: + - macos-11 + - macos-10.15 otp: - 24.0.5-emqx-1 + runs-on: ${{ matrix.macos }} + steps: - uses: actions/checkout@v1 - name: prepare @@ -82,16 +88,12 @@ jobs: id: cache with: path: ~/.kerl - key: erl${{ matrix.otp }}-macos10.15 + key: otp-${{ matrix.otp }}-${{ matrix.macos }} - name: build erlang if: steps.cache.outputs.cache-hit != 'true' timeout-minutes: 60 - env: - KERL_BUILD_BACKEND: git - OTP_GITHUB_URL: https://github.com/emqx/otp run: | - kerl update releases - kerl build ${{ matrix.otp }} + kerl build git https://github.com/emqx/otp.git OTP-${{ matrix.otp }} ${{ matrix.otp }} kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }} - name: build run: | @@ -106,8 +108,7 @@ jobs: path: ./rebar3.crashdump - name: test run: | - pkg_name=$(basename _packages/${EMQX_NAME}/emqx-*.zip) - unzip -q _packages/${EMQX_NAME}/$pkg_name + unzip -q $(find _packages/${EMQX_NAME} -mindepth 1 -maxdepth 1 -iname \*.zip | head) # gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins ./emqx/bin/emqx start || cat emqx/log/erlang.log.1 ready='no' diff --git a/build b/build index 36eb4d129..22d1f8960 100755 --- a/build +++ b/build @@ -16,7 +16,9 @@ PKG_VSN="$(./pkg-vsn.sh)" export PKG_VSN if [ "$(uname -s)" = 'Darwin' ]; then - SYSTEM=macos + DIST='macos' + VERSION_ID=$(sw_vers | gsed -n '/^ProductVersion:/p' | gsed -r 's/ProductVersion:(.*)/\1/g' | gsed -r 's/([0-9]+).*/\1/g' | gsed 's/^[ \t]*//g') + SYSTEM="$(echo "${DIST}${VERSION_ID}" | gsed -r 's/([a-zA-Z]*)-.*/\1/g')" elif [ "$(uname -s)" = 'Linux' ]; then if grep -q -i 'centos' /etc/*-release; then DIST='centos'