name: Build slim packages on: push: tags: - v* - e* pull_request: workflow_dispatch: jobs: build: runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: otp: - 24.0.5-emqx-1 os: - ubuntu20.04 - centos7 container: "ghcr.io/emqx/emqx-builder-helper/5.0:${{ matrix.otp }}-${{ matrix.os }}" steps: - uses: actions/checkout@v1 - name: prepare run: | if make emqx-ee --dry-run > /dev/null 2>&1; then echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials git config --global credential.helper store echo "${{ secrets.CI_GIT_TOKEN }}" >> ./scripts/git-token echo "EMQX_NAME=emqx-ee" >> $GITHUB_ENV else echo "EMQX_NAME=emqx" >> $GITHUB_ENV fi - name: build zip packages run: make ${EMQX_NAME}-zip - name: build deb/rpm packages run: make ${EMQX_NAME}-pkg - uses: actions/upload-artifact@v1 if: failure() with: name: rebar3.crashdump path: ./rebar3.crashdump - name: packages test run: | export CODE_PATH=$GITHUB_WORKSPACE .ci/build_packages/tests.sh - uses: actions/upload-artifact@v2 with: name: ${{ matrix.os }} path: _packages/**/*.zip mac: 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 run: | if make emqx-ee --dry-run > /dev/null 2>&1; then echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials git config --global credential.helper store echo "${{ secrets.CI_GIT_TOKEN }}" >> ./scripts/git-token echo "EMQX_NAME=emqx-ee" >> $GITHUB_ENV else echo "EMQX_NAME=emqx" >> $GITHUB_ENV fi - name: prepare run: | brew update brew install curl zip unzip gnu-sed kerl unixodbc freetds echo "/usr/local/bin" >> $GITHUB_PATH git config --global credential.helper store - uses: actions/cache@v2 id: cache with: path: ~/.kerl key: otp-${{ matrix.otp }}-${{ matrix.macos }} - name: build erlang if: steps.cache.outputs.cache-hit != 'true' timeout-minutes: 60 run: | 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: | . $HOME/.kerl/${{ matrix.otp }}/activate make ensure-rebar3 sudo cp rebar3 /usr/local/bin/rebar3 make ${EMQX_NAME}-zip - uses: actions/upload-artifact@v1 if: failure() with: name: rebar3.crashdump path: ./rebar3.crashdump - name: test run: | 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' for i in {1..10}; do if curl -fs 127.0.0.1:18083/api/v5/status > /dev/null; then ready='yes' break fi sleep 1 done if [ "$ready" != "yes" ]; then echo "Timed out waiting for emqx to be ready" cat emqx/log/erlang.log.1 exit 1 fi ./emqx/bin/emqx_ctl status ./emqx/bin/emqx stop rm -rf emqx - uses: actions/upload-artifact@v2 with: name: macos path: _packages/**/*.zip