Skip to content

fix: Fix typo

fix: Fix typo #683

Workflow file for this run

name: Build packages
on:
push:
pull_request:
release:
types:
- published
- prereleased
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
builder:
- 5.0-26
os:
- ubuntu20.04
- ubuntu18.04
- debian11
- debian10
- el8
# Fails with the following message:
# The compiler feature "cxx_std_17" is not known to CXX compiler "GNU" version 4.8.5.
# - el7
- amzn2
otp:
- 24.3.4.2-1
- 25.1.2-2
elixir:
- 1.13.4
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: build emqx packages
env:
BUILDER_IMAGE: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ 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/*"