diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 38dd9cc..d318324 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,11 +12,13 @@ jobs: fail-fast: false matrix: otp: - - "24.3.4.2-1" + - "24.3.4.2-2" elixir: - "1.13.4" steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 - uses: docker/metadata-action@v4 @@ -42,7 +44,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | - FROM=ghcr.io/emqx/emqx-builder/5.0-27:${{ matrix.elixir }}-${{ matrix.otp }}-alpine3.15.1 + FROM=ghcr.io/emqx/emqx-builder/5.0-29:${{ matrix.elixir }}-${{ matrix.otp }}-debian11 linux: runs-on: ubuntu-latest @@ -50,35 +52,40 @@ jobs: fail-fast: false matrix: otp: - - "24.3.4.2-1" + - "24.3.4.2-2" elixir: - "1.13.4" quic_support: - true - false os: + - ubuntu22.04 - ubuntu20.04 - ubuntu18.04 - ubuntu16.04 + - debian11 - debian10 - debian9 + - el9 - el8 - el7 - amzn2 container: - image: ghcr.io/emqx/emqx-builder/5.0-27:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }} + image: ghcr.io/emqx/emqx-builder/5.0-29:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }} steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - shell: bash run: | [ "false" == ${{ matrix.quic_support }} ] && export BUILD_WITHOUT_QUIC=1 + git config --global --add safe.directory /__w/emqtt-bench/emqtt-bench make - if: failure() run: cat rebar3.crashdump - run: ./_build/emqtt_bench/rel/emqtt_bench/bin/emqtt_bench - - uses: actions/upload-artifact@v2 - if: startsWith(github.ref, 'refs/tags/') + - uses: actions/upload-artifact@v3 with: name: packages path: ./*.tar.gz @@ -91,12 +98,14 @@ jobs: - macos-12 - macos-11 otp: - - "24.3.4.2-1" + - "24.3.4.2-2" runs-on: ${{ matrix.macos }} steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: prepare run: | brew install curl zip unzip gnu-sed kerl unixodbc freetds @@ -115,15 +124,13 @@ jobs: kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }} - name: Make shell: bash - env: - BUILD_WITHOUT_QUIC: 1 run: | . $HOME/.kerl/${{ matrix.otp }}/activate make - if: failure() run: cat rebar3.crashdump - run: ./_build/emqtt_bench/rel/emqtt_bench/bin/emqtt_bench - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 if: startsWith(github.ref, 'refs/tags/') with: name: packages diff --git a/Dockerfile b/Dockerfile index 614b649..03cda4d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG FROM=ghcr.io/emqx/emqx-builder/5.0-16:1.13.4-24.2.1-1-alpine3.15.1 +ARG FROM=ghcr.io/emqx/emqx-builder/5.0-29:1.13.4-24.3.4.2-2-debian11 FROM ${FROM} COPY . /emqtt_bench WORKDIR /emqtt_bench diff --git a/rebar.config b/rebar.config index e604a37..e36bb07 100644 --- a/rebar.config +++ b/rebar.config @@ -16,7 +16,7 @@ {deps, [ {getopt, {git, "https://github.com/zmstone/getopt", {tag, "v1.0.2.1"}}}, - {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.6.1"}}} + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.8.2"}}} ]}. {escript_name, emqtt_bench}. diff --git a/rebar.config.script b/rebar.config.script index 233d57c..61a6876 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -11,7 +11,7 @@ IsWin32 = fun() -> win32 =:= element(1, os:type()) end, -Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.16"}}}, +Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.111"}}}, IsQuicSupp = not (IsCentos6() orelse IsWin32() orelse false =/= os:getenv("BUILD_WITHOUT_QUIC") diff --git a/scripts/rename-package.sh b/scripts/rename-package.sh index 66da719..86204ff 100755 --- a/scripts/rename-package.sh +++ b/scripts/rename-package.sh @@ -4,20 +4,28 @@ set -euo pipefail cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.." -if [ "$(uname -s)" = 'Darwin' ]; then - 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' - VERSION_ID="$(rpm --eval '%{centos_ver}')" - else - DIST="$(sed -n '/^ID=/p' /etc/os-release | sed -r 's/ID=(.*)/\1/g' | sed 's/"//g')" - VERSION_ID="$(sed -n '/^VERSION_ID=/p' /etc/os-release | sed -r 's/VERSION_ID=(.*)/\1/g' | sed 's/"//g')" - fi - SYSTEM="$(echo "${DIST}${VERSION_ID}" | sed -r 's/([a-zA-Z]*)-.*/\1/g')" -fi +UNAME="$(uname -s)" +case "$UNAME" in + Darwin) + DIST='macos' + VERSION_ID="$(sw_vers | grep 'ProductVersion' | cut -d':' -f 2 | cut -d'.' -f1 | tr -d ' \t')" + SYSTEM="${DIST}${VERSION_ID}" + ;; + Linux) + # /etc/os-release on amazon linux 2 contains both rhel and centos strings + if grep -q -i 'amzn' /etc/*-release; then + DIST='amzn' + VERSION_ID="$(sed -n '/^VERSION_ID=/p' /etc/os-release | sed -r 's/VERSION_ID=(.*)/\1/g' | sed 's/"//g')" + elif grep -q -i 'rhel' /etc/*-release; then + DIST='el' + VERSION_ID="$(rpm --eval '%{rhel}')" + else + DIST="$(sed -n '/^ID=/p' /etc/os-release | sed -r 's/ID=(.*)/\1/g' | sed 's/"//g')" + VERSION_ID="$(sed -n '/^VERSION_ID=/p' /etc/os-release | sed -r 's/VERSION_ID=(.*)/\1/g' | sed 's/"//g')" + fi + SYSTEM="$(echo "${DIST}${VERSION_ID}" | sed -r 's/([a-zA-Z]*)-.*/\1/g')" + ;; +esac ARCH="$(uname -m)" case "$ARCH" in