Skip to content

Release

Release #55

Workflow file for this run

name: Release
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
ref:
type: string
required: true
dryrun:
type: boolean
required: true
default: false
jobs:
# Build documentation once, since it requires a lot of 3rd party
# tooling, then reuse it as an artifact:
docs:
runs-on: ubuntu-latest
container:
image: ghcr.io/emqx/emqx-builder/5.3-6:1.15.7-26.2.3-1-ubuntu24.04
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
- shell: bash
name: Install additional packages
run: |
apt-get update
apt-get install -y openjdk-11-jdk asciidoctor xsltproc docbook-xsl python3-pygments
- name: Build
shell: bash
run: |
export BUILD_WITHOUT_QUIC=1
git config --global --add safe.directory $(pwd)
make release
tar czf docs.tar.gz _build/lee_doc/html _build/lee_doc/man _build/lee_doc/src/
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: docs
path: docs.tar.gz
# Do normal builds:
linux:
runs-on: ubuntu-latest
needs: docs
strategy:
fail-fast: false
matrix:
otp:
- "25.3.2-2"
- "26.2.3-1"
os:
- ubuntu24.04
- ubuntu22.04
- ubuntu20.04
- debian12
- debian11
- debian10
- el9
- el8
- el7
- amzn2
- amzn2023
env:
EMQX_BUILDER: ghcr.io/emqx/emqx-builder/5.3-6:1.15.7-${{ matrix.otp }}-${{ matrix.os }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: docs
path: .
- name: Build
shell: bash
run: |
tar xf docs.tar.gz
docker run -t --rm -v $(pwd):/emqttb -w /emqttb -e CAN_BUILD_DOCS=false -e REBAR=/usr/local/bin/rebar3 $EMQX_BUILDER bash -c 'git config --global --add safe.directory /emqttb && make release'
- name: Test
shell: bash
run: |
mkdir test-package
cp *.tar.gz test-package/
cd test-package
docker run -t --rm -v $(pwd):/emqttb -w /emqttb $EMQX_BUILDER bash -c 'tar xfz emqttb*.tar.gz && timeout -s 9 5s bin/emqttb @pub -t t/%n'
- if: failure()
run: cat rebar3.crashdump
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: startsWith(github.ref, 'refs/tags/')
with:
name: packages-${{ matrix.os }}-${{ matrix.otp }}
path: ./*.tar.gz
mac:
strategy:
fail-fast: false
matrix:
macos:
- macos-13
- macos-14
otp:
- "25"
- "26"
runs-on: ${{ matrix.macos }}
needs: docs
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
- name: prepare
run: |
brew install coreutils erlang@${{ matrix.otp }}
brew link --force erlang@${{ matrix.otp }}
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: docs
path: .
- name: build
shell: bash
run: |
tar xf docs.tar.gz
export CAN_BUILD_DOCS=false
export BUILD_WITHOUT_QUIC=1
make release
- if: failure()
run: cat rebar3.crashdump
- run: ./_build/default/bin/emqttb
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: startsWith(github.ref, 'refs/tags/')
with:
name: packages-${{ matrix.macos }}-${{ matrix.otp }}
path: ./*.tar.gz
release:
runs-on: ubuntu-latest
needs:
- linux
- mac
if: startsWith(github.ref, 'refs/tags/') && !inputs.dryrun
steps:
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
pattern: "packages-*"
path: packages
merge-multiple: true
- name: Create Release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: EMQTT bench daemon ${{ github.ref }} Released
body: EMQTT bench daemon ${{ github.ref }} Released
draft: false
prerelease: false
- uses: Rory-Z/upload-release-asset@v1
with:
repo: emqttb
path: "packages/emqttb-*"
token: ${{ github.token }}