Skip to content

Commit

Permalink
Merge pull request #206 from id/230223-ci-more-os-versions-and-fix-pa…
Browse files Browse the repository at this point in the history
…ckage-names

ci: release packages for ubuntu22.04, debian11 and el9
  • Loading branch information
id authored Feb 23, 2023
2 parents 4e86df1 + 58b65b7 commit b850a22
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 27 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,43 +44,48 @@ 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
strategy:
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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand Down
2 changes: 1 addition & 1 deletion rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
36 changes: 22 additions & 14 deletions scripts/rename-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b850a22

Please sign in to comment.