Merge pull request #247 from keynslug/feat/respect-receive-max #932
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: Build packages | |
on: | |
push: | |
pull_request: | |
release: | |
types: | |
- published | |
- prereleased | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
builder: | |
- 5.2-7:1.15.7-26.1.2-1 | |
os: | |
- ubuntu20.04 | |
- ubuntu22.04 | |
- debian11 | |
- debian12 | |
- el9 | |
- amzn2 | |
- amzn2023 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: build emqx packages | |
env: | |
BUILDER_IMAGE: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}-${{ matrix.os }}" | |
# NOTE | |
# Doing it manually instead of just setting `container` for the job because of | |
# discrepancies in the images' environments affecting even basic things like | |
# repo checkouts. | |
run: | | |
docker run --rm --name emqtt-${{ matrix.os }}-build -v $(pwd):/emqtt --workdir /emqtt ${BUILDER_IMAGE} /bin/bash -c ' | |
git config --global --add safe.directory "${PWD}" | |
.github/workflows/script/build.sh | |
' | |
sudo bash -c ' | |
cd _packages | |
for var in $(ls); do echo $(sha256sum $var | awk "{print $1}") > $var.sha256; done | |
' | |
- uses: actions/upload-artifact@v3 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
name: packages | |
path: _packages/* | |
build-on-mac: | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
otp: | |
- 24 | |
- 25 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: prepare | |
run: | | |
# See https://github.com/actions/setup-python/issues/577 | |
# brew update | |
brew install curl zip unzip gnu-sed erlang@${{ matrix.otp }} coreutils | |
echo "$(brew --prefix)/opt/erlang@${{ matrix.otp }}/bin" >> $GITHUB_PATH | |
echo "$(brew --prefix)/opt/unzip/bin" >> $GITHUB_PATH | |
echo "$(brew --prefix)/bin" >> $GITHUB_PATH | |
- name: build | |
run: | | |
echo "${PATH}" | |
erl -noshell -eval 'io:format(erlang:system_info(otp_release)), halt(0).' | |
.github/workflows/script/build.sh | |
pkg=emqtt-macos-$(git describe --tags --always).zip | |
openssl dgst -sha256 _packages/$pkg | awk '{print $2}' > _packages/$pkg.sha256 | |
- uses: actions/upload-artifact@v3 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
name: packages-mac | |
path: _packages/* | |
release: | |
runs-on: ubuntu-latest | |
needs: [build, build-on-mac] | |
if: ${{ github.event_name == 'release' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: packages | |
path: _packages | |
- uses: actions/download-artifact@v3 | |
with: | |
name: packages-mac | |
path: _packages | |
- name: set aws | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
aws-access-key-id: ${{ secrets.AwsAccessKeyId }} | |
aws-secret-access-key: ${{ secrets.AwsSecretAccessKey }} | |
aws-region: us-west-2 | |
- name: verify packages | |
working-directory: _packages | |
run: | | |
for var in $(ls | grep emqtt | grep -v sha256); do | |
echo "$(cat $var.sha256) $var" | sha256sum -c || exit 1 | |
done | |
- name: upload aws | |
run: | | |
version=$(echo ${{ github.ref }} | sed -r "s .*/.*/(.*) \1 g") | |
aws s3 cp --recursive ./_packages s3://packages.emqx.io/emqtt/$version | |
aws cloudfront create-invalidation --distribution-id E3TYD0WSP4S14P --paths "/emqtt/$version/*" | |
- name: upload github | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "_packages/*" |