Skip to content

Commit

Permalink
Merge pull request #228 from id/0708-disable-jit-when-building-on-mac
Browse files Browse the repository at this point in the history
  • Loading branch information
id authored Aug 7, 2023
2 parents 77aef77 + 966432a commit 4031ed5
Show file tree
Hide file tree
Showing 2 changed files with 233 additions and 82 deletions.
91 changes: 9 additions & 82 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
name: build
on:
pull_request:
push:
tags:
- "*"
- "!v*"
workflow_dispatch:
inputs:
branch_or_tag:
required: false
publish_release_artifacts:
type: boolean
required: true
default: false

jobs:
docker:
Expand All @@ -27,7 +15,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch_or_tag }}
fetch-depth: 0
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
Expand All @@ -50,7 +37,7 @@ jobs:
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ startsWith(github.ref, 'refs/tags/') || inputs.publish_release_artifacts == true }}
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
Expand All @@ -70,34 +57,22 @@ jobs:
- false
os:
- ubuntu22.04
- ubuntu20.04
- ubuntu18.04
- ubuntu16.04
- debian12
- debian11
- debian10
- debian9
- el9
- el8
- el7
- amzn2
- amzn2023

container:
image: ghcr.io/emqx/emqx-builder/5.1-3:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch_or_tag }}
- shell: bash
run: |
[ "false" == ${{ matrix.quic_support }} ] && export BUILD_WITHOUT_QUIC=1
git config --global --add safe.directory $(pwd)
make
- if: failure()
run: cat rebar3.crashdump
- name: Verify that we have working release
- name: test release
run: |
set -e
mkdir test-release
Expand Down Expand Up @@ -126,13 +101,12 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch_or_tag }}
- name: prepare
run: |
brew install curl zip unzip gnu-sed kerl unixodbc freetds
echo "/usr/local/bin" >> $GITHUB_PATH
git config --global credential.helper store
- uses: actions/cache@v2
- uses: actions/cache@v3
id: cache
with:
path: ~/.kerl
Expand All @@ -142,26 +116,28 @@ jobs:
timeout-minutes: 60
env:
OTP: ${{ matrix.otp }}
KERL_CONFIGURE_OPTIONS: '--disable-hipe --disable-jit'
run: |
set -eux
if [ ! -d $HOME/.kerl/$OTP ]; then
kerl build git https://github.com/emqx/otp.git OTP-$OTP $OTP
kerl install $OTP $HOME/.kerl/$OTP
fi
- name: Make
- name: build
env:
OTP: ${{ matrix.otp }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_DEVELOPER_IDENTITY: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
APPLE_DEVELOPER_ID_BUNDLE: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
APPLE_DEVELOPER_ID_BUNDLE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
run: |
. $HOME/.kerl/${{ matrix.otp }}/activate
. $HOME/.kerl/$OTP/activate
make
- if: failure()
run: cat rebar3.crashdump
- name: Verify that we have working release
- name: test release
run: |
set -e
mkdir test-release
Expand All @@ -170,55 +146,6 @@ jobs:
unzip -q ./emqtt-bench*.zip
bin/emqtt_bench
- uses: actions/upload-artifact@v3
if: startsWith(github.ref, 'refs/tags/') || inputs.publish_release_artifacts
with:
name: packages
path: ./*.zip

release:
runs-on: ubuntu-latest
needs:
- linux
- mac
if: startsWith(github.ref, 'refs/tags/') || inputs.publish_release_artifacts

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 ${{ github.ref }} Released
body: Emqtt Bench ${{ github.ref }} Released
draft: false
prerelease: false
- uses: Rory-Z/upload-release-asset@v1
with:
repo: emqtt-bench
path: "packages/emqtt-bench-*"
token: ${{ github.token }}
- uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: upload to aws s3
run: |
set -euo pipefail
aws s3 cp --recursive packages s3://${{ secrets.AWS_S3_BUCKET }}/emqtt-bench/${{ github.ref_name }}
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_ID }} --paths "/emqtt-bench/${{ github.ref_name }}/*"
- name: update to emqx.io
run: |
set -eux
curl -w %{http_code} \
--insecure \
-H "Content-Type: application/json" \
-H "token: ${{ secrets.EMQX_IO_TOKEN }}" \
-X POST \
-d "{\"repo\":\"emqx/emqtt-bench\", \"tag\": \"${{ github.ref_name }}\" }" \
${{ secrets.EMQX_IO_RELEASE_API }}
Loading

0 comments on commit 4031ed5

Please sign in to comment.