Skip to content

Release

Release #33

Workflow file for this run

name: Release
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
build_from:
description: |
Branch or tag to build release artifacts from.
required: false
release_as:
description: |
Publish release under this tag, or update release assets if such release exists.
If empty, release publishing will be skipped.
required: false
default: ""
jobs:
mac:
strategy:
fail-fast: false
matrix:
otp:
- "26"
- "27"
rebar3:
- "3.22.0"
os:
- macos-14
- macos-15
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
ref: ${{ github.event.inputs.build_from }} # when input is not given, the event tag is used
- name: install erlang & build tooling
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
brew update
brew install automake libtool
brew install erlang@${{ matrix.otp }}
echo "$(brew --prefix erlang@${{ matrix.otp }})/bin" >> $GITHUB_PATH
- name: install rebar3
run: |
wget https://github.com/erlang/rebar3/releases/download/${{ matrix.rebar3 }}/rebar3 && chmod +x rebar3
sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3
- name: build release
run: |
env BUILD_RELEASE=1 CI_RELEASE_VERSION=${{ github.event.inputs.release_as }} ./build.sh
- uses: actions/upload-artifact@v3
with:
name: packages
path: |
_packages/*.tar.gz
_packages/*.tar.gz.sha256
linux:
strategy:
fail-fast: false
matrix:
builder:
- 5.4-4:1.15.7-26.2.5.2-3
- 5.4-4:1.17.3-27.2-2
arch:
- amd64
- arm64
os:
- ubuntu24.04
- ubuntu22.04
- ubuntu20.04
- debian12
- debian11
- debian10
- amzn2
- amzn2023
- el8
- el9
- alpine3.15.1
runs-on: ubuntu-latest
env:
IMAGE: ghcr.io/emqx/emqx-builder/${{ matrix.builder }}-${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
ref: ${{ github.event.inputs.build_from }} # when input is not given, the event tag is used
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-qemu-action@v2
with:
platforms: ${{ matrix.arch }}
- name: build release
if: matrix.os == 'amzn2'
run: |
docker build --platform=linux/${{ matrix.arch }} --build-arg FROM=$IMAGE -t emqx-builder:amzn2 -f .ci/Dockerfile.amzn2 .
docker run -i --rm --user 1001 -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} -e BUILD_RELEASE=1 -e CI_RELEASE_VERSION=${{ github.event.inputs.release_as }} emqx-builder:amzn2 bash -euc './build.sh'
- name: build release
if: matrix.os != 'amzn2'
run: |
docker run -i --rm --user 1001 -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} -e BUILD_RELEASE=1 -e CI_RELEASE_VERSION=${{ github.event.inputs.release_as }} $IMAGE bash -euc './build.sh'
- uses: actions/upload-artifact@v3
with:
name: packages
path: |
_packages/*.tar.gz
_packages/*.tar.gz.sha256
release:
runs-on: ubuntu-latest
needs:
- mac
- linux
if: startsWith(github.ref, 'refs/tags/') || inputs.release_as
steps:
- uses: actions/download-artifact@v4
with:
name: packages
path: packages
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Erlang jq NIF ${{ github.event.inputs.release_as || github.ref_name }} Released
tag_name: ${{ github.event.inputs.release_as || github.ref_name }}
files: "packages/*"