Merge pull request #62 from emqx/dev/verify-sequence #46
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.0-34:1.13.4-25.1.2-3-ubuntu22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
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@v3 | |
with: | |
name: docs | |
path: docs.tar.gz | |
# Do normal builds: | |
linux: | |
runs-on: ubuntu-latest | |
needs: docs | |
strategy: | |
fail-fast: false | |
matrix: | |
otp: | |
- "25.1.2-3" | |
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-34:1.13.4-${{ matrix.otp }}-${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.ref }} | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: docs | |
path: . | |
- name: Build | |
shell: bash | |
run: | | |
git config --global --add safe.directory $(pwd) | |
tar xf docs.tar.gz | |
export CAN_BUILD_DOCS=false | |
make release | |
- if: failure() | |
run: cat rebar3.crashdump | |
- run: ./_build/default/bin/emqttb | |
- uses: actions/upload-artifact@v3 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: packages | |
path: ./*.tar.gz | |
mac: | |
strategy: | |
fail-fast: false | |
matrix: | |
macos: | |
- macos-12 | |
otp: | |
- "25" | |
runs-on: ${{ matrix.macos }} | |
needs: docs | |
steps: | |
- uses: actions/checkout@v3 | |
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@v3 | |
with: | |
name: docs | |
path: . | |
- name: build | |
shell: bash | |
run: | | |
tar xf docs.tar.gz | |
export CAN_BUILD_DOCS=false | |
make release | |
- if: failure() | |
run: cat rebar3.crashdump | |
- run: ./_build/default/bin/emqttb | |
- uses: actions/upload-artifact@v3 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: packages | |
path: ./*.tar.gz | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- linux | |
- mac | |
if: startsWith(github.ref, 'refs/tags/') && !inputs.dryrun | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: packages | |
path: packages | |
- name: Create Release | |
uses: actions/create-release@v1 | |
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 }} |