| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- name: Push Entrypoint
- concurrency:
- group: push-entrypoint-${{ github.event_name }}-${{ github.ref }}
- cancel-in-progress: true
- on:
- push:
- tags:
- - 'v*'
- branches:
- - 'master'
- - 'release-5[0-9]'
- - 'ci/**'
- workflow_dispatch:
- inputs:
- ref:
- required: false
- permissions:
- contents: read
- defaults:
- run:
- shell: bash
- env:
- IS_CI: 'yes'
- jobs:
- init:
- runs-on: ubuntu-22.04
- outputs:
- BUILDER_VSN: ${{ steps.env.outputs.BUILDER_VSN }}
- OTP_VSN: ${{ steps.env.outputs.OTP_VSN }}
- ELIXIR_VSN: ${{ steps.env.outputs.ELIXIR_VSN }}
- BUILDER: ${{ steps.env.outputs.BUILDER }}
- steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- with:
- ref: ${{ github.event.inputs.ref }}
- - name: Set up environment
- id: env
- run: |
- source env.sh
- echo "BUILDER_VSN=$EMQX_BUILDER_VSN" >> "$GITHUB_OUTPUT"
- echo "OTP_VSN=$OTP_VSN" >> "$GITHUB_OUTPUT"
- echo "ELIXIR_VSN=$ELIXIR_VSN" >> "$GITHUB_OUTPUT"
- echo "BUILDER=$EMQX_BUILDER" >> "$GITHUB_OUTPUT"
- prepare:
- runs-on: ubuntu-22.04
- needs: init
- container: ${{ needs.init.outputs.BUILDER }}
- outputs:
- profile: ${{ steps.parse-git-ref.outputs.profile }}
- release: ${{ steps.parse-git-ref.outputs.release }}
- latest: ${{ steps.parse-git-ref.outputs.latest }}
- ct-matrix: ${{ steps.matrix.outputs.ct-matrix }}
- ct-host: ${{ steps.matrix.outputs.ct-host }}
- ct-docker: ${{ steps.matrix.outputs.ct-docker }}
- steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- with:
- ref: ${{ github.event.inputs.ref }}
- fetch-depth: 0
- - name: Work around https://github.com/actions/checkout/issues/766
- shell: bash
- run: |
- git config --global --add safe.directory "$GITHUB_WORKSPACE"
- - name: Detect emqx profile
- id: parse-git-ref
- run: |
- JSON="$(./scripts/parse-git-ref.sh $GITHUB_REF)"
- PROFILE=$(echo "$JSON" | jq -cr '.profile')
- RELEASE=$(echo "$JSON" | jq -cr '.release')
- LATEST=$(echo "$JSON" | jq -cr '.latest')
- echo "profile=$PROFILE" | tee -a $GITHUB_OUTPUT
- echo "release=$RELEASE" | tee -a $GITHUB_OUTPUT
- echo "latest=$LATEST" | tee -a $GITHUB_OUTPUT
- - name: Build matrix
- id: matrix
- run: |
- MATRIX="$(./scripts/find-apps.sh --ci)"
- echo "${MATRIX}" | jq
- CT_MATRIX="$(echo "${MATRIX}" | jq -c 'map({profile}) | unique')"
- CT_HOST="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "host"))')"
- CT_DOCKER="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "docker"))')"
- echo "ct-matrix=${CT_MATRIX}" | tee -a $GITHUB_OUTPUT
- echo "ct-host=${CT_HOST}" | tee -a $GITHUB_OUTPUT
- echo "ct-docker=${CT_DOCKER}" | tee -a $GITHUB_OUTPUT
- build_packages:
- if: needs.prepare.outputs.release == 'true'
- needs:
- - init
- - prepare
- uses: ./.github/workflows/build_packages.yaml
- with:
- profile: ${{ needs.prepare.outputs.profile }}
- publish: true
- otp_vsn: ${{ needs.init.outputs.OTP_VSN }}
- elixir_vsn: ${{ needs.init.outputs.ELIXIR_VSN }}
- builder_vsn: ${{ needs.init.outputs.BUILDER_VSN }}
- secrets: inherit
- build_and_push_docker_images:
- if: needs.prepare.outputs.release == 'true'
- needs:
- - init
- - prepare
- uses: ./.github/workflows/build_and_push_docker_images.yaml
- with:
- profile: ${{ needs.prepare.outputs.profile }}
- publish: true
- latest: ${{ needs.prepare.outputs.latest }}
- secrets: inherit
- build_slim_packages:
- if: needs.prepare.outputs.release != 'true'
- needs:
- - init
- - prepare
- uses: ./.github/workflows/build_slim_packages.yaml
- compile:
- runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
- container: ${{ needs.init.outputs.BUILDER }}
- needs:
- - init
- - prepare
- strategy:
- matrix:
- profile:
- - emqx
- - emqx-enterprise
- steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- with:
- ref: ${{ github.event.inputs.ref }}
- fetch-depth: 0
- - name: Work around https://github.com/actions/checkout/issues/766
- run: |
- git config --global --add safe.directory "$GITHUB_WORKSPACE"
- - id: compile
- env:
- PROFILE: ${{ matrix.profile }}
- ENABLE_COVER_COMPILE: 1
- run: |
- make $PROFILE
- echo "export PROFILE=${PROFILE}" | tee -a env.sh
- echo "export PKG_VSN=$(./pkg-vsn.sh ${PROFILE})" | tee -a env.sh
- zip -ryq -x@.github/workflows/.zipignore $PROFILE.zip .
- make ${PROFILE}-rel
- - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
- with:
- name: ${{ matrix.profile }}
- path: ${{ matrix.profile }}.zip
- retention-days: 7
- - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
- with:
- name: "${{ matrix.profile }}-schema-dump"
- path: |
- env.sh
- _build/docgen/${{ matrix.profile }}/*.json
- _build/docgen/${{ matrix.profile }}/*.hocon
- retention-days: 7
- performance_test:
- if: needs.prepare.outputs.release == 'true'
- needs:
- - init
- - prepare
- - build_packages
- runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
- permissions:
- actions: write
- steps:
- - name: Trigger performance test
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- gh --repo ${{ github.repository }} workflow run performance_test.yaml -f version=${GITHUB_REF_NAME##[v|e]}
- update_emqx_i18n:
- if: needs.prepare.outputs.release == 'true'
- needs:
- - prepare
- - compile
- runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
- steps:
- - name: Generate GitHub App token
- id: app-token
- uses: actions/create-github-app-token@v1
- with:
- app-id: ${{ vars.AUTH_APP_ID }}
- private-key: ${{ secrets.AUTH_APP_PRIVATE_KEY }}
- owner: ${{ github.repository_owner }}
- - name: Create PR in emqx/emqx-i18n
- env:
- GH_TOKEN: ${{ steps.app-token.outputs.token }}
- run: |
- gh --repo emqx/emqx-i18n workflow run sync-en-doc.yaml -f version=${GITHUB_REF_NAME##[v|e]} -f repository=${GITHUB_REPOSITORY} -f run_id=${GITHUB_RUN_ID}
- run_emqx_app_tests:
- if: needs.prepare.outputs.release != 'true'
- needs:
- - init
- - prepare
- - compile
- uses: ./.github/workflows/run_emqx_app_tests.yaml
- with:
- builder: ${{ needs.init.outputs.BUILDER }}
- before_ref: ${{ github.event.before }}
- after_ref: ${{ github.sha }}
- run_test_cases:
- if: needs.prepare.outputs.release != 'true'
- needs:
- - init
- - prepare
- - compile
- permissions:
- contents: read
- pull-requests: write
- uses: ./.github/workflows/run_test_cases.yaml
- with:
- builder: ${{ needs.init.outputs.BUILDER }}
- ct-matrix: ${{ needs.prepare.outputs.ct-matrix }}
- ct-host: ${{ needs.prepare.outputs.ct-host }}
- ct-docker: ${{ needs.prepare.outputs.ct-docker }}
- run_conf_tests:
- if: needs.prepare.outputs.release != 'true'
- needs:
- - init
- - prepare
- - compile
- uses: ./.github/workflows/run_conf_tests.yaml
- with:
- builder: ${{ needs.init.outputs.BUILDER }}
- static_checks:
- if: needs.prepare.outputs.release != 'true'
- needs:
- - init
- - prepare
- - compile
- uses: ./.github/workflows/static_checks.yaml
- with:
- builder: ${{ needs.init.outputs.BUILDER }}
- ct-matrix: ${{ needs.prepare.outputs.ct-matrix }}
|