build_packages.yaml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. name: Cross build packages
  2. concurrency:
  3. group: build-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. schedule:
  7. - cron: '0 */6 * * *'
  8. push:
  9. branches:
  10. - 'ci/**'
  11. tags:
  12. - v*
  13. - e*
  14. workflow_dispatch:
  15. inputs:
  16. which_branch:
  17. required: false
  18. jobs:
  19. prepare:
  20. runs-on: ubuntu-20.04
  21. # prepare source with any OTP version, no need for a matrix
  22. container: "ghcr.io/emqx/emqx-builder/5.0-8:1.13.3-24.2.1-1-ubuntu20.04"
  23. outputs:
  24. DEP_QUICER_REF: ${{ steps.deps-refs.outputs.DEP_QUICER_REF }}
  25. steps:
  26. - uses: actions/checkout@v2
  27. with:
  28. ref: ${{ github.event.inputs.which_branch }}
  29. path: source
  30. fetch-depth: 0
  31. - name: Get deps git refs for cache
  32. id: deps-refs
  33. working-directory: source
  34. run: |
  35. bash -x scripts/get-dep-refs.sh
  36. make clean-all
  37. - name: get_all_deps
  38. run: |
  39. make -C source deps-all
  40. zip -ryq source.zip source/* source/.[^.]*
  41. - uses: actions/upload-artifact@v2
  42. with:
  43. name: source
  44. path: source.zip
  45. windows:
  46. runs-on: windows-2019
  47. needs: prepare
  48. strategy:
  49. fail-fast: false
  50. matrix:
  51. profile: # for now only CE for windows
  52. - emqx
  53. otp:
  54. - 24.2.1
  55. steps:
  56. - uses: actions/download-artifact@v2
  57. with:
  58. name: source
  59. path: .
  60. - name: unzip source code
  61. run: Expand-Archive -Path source.zip -DestinationPath ./
  62. - uses: ilammy/msvc-dev-cmd@v1
  63. - uses: erlef/setup-beam@v1
  64. with:
  65. otp-version: ${{ matrix.otp }}
  66. - name: build
  67. env:
  68. PYTHON: python
  69. DIAGNOSTIC: 1
  70. working-directory: source
  71. run: |
  72. # ensure crypto app (openssl)
  73. erl -eval "erlang:display(crypto:info_lib())" -s init stop
  74. make ${{ matrix.profile }}-tgz
  75. - name: run emqx
  76. timeout-minutes: 5
  77. working-directory: source
  78. run: |
  79. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx start
  80. Start-Sleep -s 5
  81. echo "EMQX started"
  82. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx stop
  83. echo "EMQX stopped"
  84. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx install
  85. echo "EMQX installed"
  86. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx uninstall
  87. echo "EMQX uninstalled"
  88. - uses: actions/upload-artifact@v1
  89. if: startsWith(github.ref, 'refs/tags/')
  90. with:
  91. name: ${{ matrix.profile }}-windows
  92. path: source/_packages/${{ matrix.profile }}/.
  93. mac:
  94. needs: prepare
  95. strategy:
  96. fail-fast: false
  97. matrix:
  98. profile: # no EDGE for mac
  99. - emqx
  100. - emqx-enterprise
  101. otp:
  102. - 24.2.1-1
  103. os:
  104. - macos-11
  105. - macos-10.15
  106. exclude:
  107. - profile: emqx-edge
  108. runs-on: ${{ matrix.os }}
  109. steps:
  110. - uses: actions/download-artifact@v2
  111. with:
  112. name: source
  113. path: .
  114. - name: unzip source code
  115. run: unzip -q source.zip
  116. - name: prepare
  117. run: |
  118. brew update
  119. brew install curl zip unzip gnu-sed kerl unixodbc freetds
  120. echo "/usr/local/bin" >> $GITHUB_PATH
  121. git config --global credential.helper store
  122. - uses: actions/cache@v2
  123. id: cache
  124. with:
  125. path: ~/.kerl/${{ matrix.otp }}
  126. key: otp-install-${{ matrix.otp }}-${{ matrix.os }}
  127. - name: build erlang
  128. if: steps.cache.outputs.cache-hit != 'true'
  129. timeout-minutes: 60
  130. env:
  131. KERL_BUILD_BACKEND: git
  132. OTP_GITHUB_URL: https://github.com/emqx/otp
  133. run: |
  134. kerl update releases
  135. kerl build ${{ matrix.otp }}
  136. kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }}
  137. - name: load quicer cache
  138. uses: actions/cache@v2
  139. with:
  140. path: source/_build/default/lib/quicer/
  141. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ needs.prepare.outputs.DEP_QUICER_REF }}
  142. - name: build
  143. working-directory: source
  144. run: |
  145. . $HOME/.kerl/${{ matrix.otp }}/activate
  146. make ensure-rebar3
  147. sudo cp rebar3 /usr/local/bin/rebar3
  148. rm -rf _build/${{ matrix.profile }}/lib
  149. make ${{ matrix.profile }}-tgz
  150. - name: test
  151. working-directory: source
  152. run: |
  153. pkg_name=$(find _packages/${{ matrix.profile }} -mindepth 1 -maxdepth 1 -iname \*.tar.gz)
  154. tar -zxf $pkg_name
  155. # gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins
  156. ./emqx/bin/emqx start || cat emqx/log/erlang.log.1
  157. ready='no'
  158. for i in {1..10}; do
  159. if curl -fs 127.0.0.1:18083/api/v5/status > /dev/null; then
  160. ready='yes'
  161. break
  162. fi
  163. sleep 1
  164. done
  165. if [ "$ready" != "yes" ]; then
  166. echo "Timed out waiting for emqx to be ready"
  167. cat emqx/log/erlang.log.1
  168. exit 1
  169. fi
  170. ./emqx/bin/emqx_ctl status
  171. ./emqx/bin/emqx stop
  172. rm -rf emqx
  173. - uses: actions/upload-artifact@v1
  174. if: startsWith(github.ref, 'refs/tags/')
  175. with:
  176. name: ${{ matrix.profile }}-${{ matrix.otp }}
  177. path: source/_packages/${{ matrix.profile }}/.
  178. linux:
  179. needs: prepare
  180. runs-on: ${{ matrix.build_machine }}
  181. container:
  182. image: "ghcr.io/emqx/emqx-builder/5.0-8:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
  183. strategy:
  184. fail-fast: false
  185. matrix:
  186. profile: ## all editions for linux
  187. - emqx-edge
  188. - emqx
  189. - emqx-enterprise
  190. otp:
  191. - 24.2.1-1 # we test with OTP 23, but only build package on OTP 24 versions
  192. elixir:
  193. - 1.13.3
  194. # used to split elixir packages into a separate job, since the
  195. # entire job may take a lot of time, especially on arm64
  196. # emulation.
  197. # we only want to build ubuntu and centos with elixir for the
  198. # time being, so it's easier to just include those with
  199. # `with_elixir` set.
  200. build_elixir:
  201. # - with_elixir
  202. - no_elixir
  203. arch:
  204. - amd64
  205. - arm64
  206. os:
  207. - ubuntu20.04
  208. - ubuntu18.04
  209. - ubuntu16.04
  210. - debian11
  211. - debian10
  212. - debian9
  213. - rockylinux8
  214. - centos7
  215. - raspbian10
  216. build_machine:
  217. - aws-arm64
  218. - ubuntu-20.04
  219. exclude:
  220. - arch: arm64
  221. build_machine: ubuntu-20.04
  222. - arch: amd64
  223. build_machine: aws-arm64
  224. - os: raspbian9
  225. arch: amd64
  226. - os: raspbian10
  227. arch: amd64
  228. - os: raspbian10 # we only have arm32 image
  229. arch: arm64
  230. - os: raspbian9
  231. profile: emqx
  232. - os: raspbian10
  233. profile: emqx
  234. - os: raspbian9
  235. profile: emqx-enterprise
  236. - os: raspbian10
  237. profile: emqx-enterprise
  238. include:
  239. - profile: emqx
  240. otp: 24.2.1-1
  241. elixir: 1.13.3
  242. build_elixir: with_elixir
  243. arch: amd64
  244. os: ubuntu20.04
  245. build_machine: ubuntu-20.04
  246. - profile: emqx
  247. otp: 24.2.1-1
  248. elixir: 1.13.3
  249. build_elixir: with_elixir
  250. arch: amd64
  251. os: centos7
  252. build_machine: ubuntu-20.04
  253. defaults:
  254. run:
  255. shell: bash
  256. steps:
  257. - uses: AutoModality/action-clean@v1
  258. if: matrix.build_machine == 'aws-arm64'
  259. - uses: actions/download-artifact@v2
  260. with:
  261. name: source
  262. path: .
  263. - name: unzip source code
  264. run: unzip -q source.zip
  265. - name: load quicer cache
  266. uses: actions/cache@v2
  267. with:
  268. path: |
  269. source/_build/default/lib/quicer/
  270. source/deps/quicer/
  271. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ needs.prepare.outputs.DEP_QUICER_REF }}
  272. - name: build emqx packages
  273. working-directory: source
  274. env:
  275. OTP: ${{ matrix.otp }}
  276. ELIXIR: ${{ matrix.elixir }}
  277. PROFILE: ${{ matrix.profile }}
  278. ARCH: ${{ matrix.arch }}
  279. SYSTEM: ${{ matrix.os }}
  280. run: |
  281. set -eu
  282. # Align path for CMake caches
  283. if [ ! "$PWD" = "/emqx" ]; then
  284. ln -s $PWD /emqx
  285. cd /emqx
  286. fi
  287. echo "pwd is $PWD"
  288. PkgTypes="tgz pkg"
  289. IsElixir="no"
  290. if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
  291. PkgTypes="tgz"
  292. # set Elixir build flag
  293. IsElixir="yes"
  294. fi
  295. for PKGTYPE in ${PkgTypes};
  296. do
  297. ./scripts/buildx.sh \
  298. --profile "${PROFILE}" \
  299. --pkgtype "${PKGTYPE}" \
  300. --arch "${ARCH}" \
  301. --otp "${OTP}" \
  302. --elixir "${IsElixir}" \
  303. --elixir-vsn "${ELIXIR}" \
  304. --system "${SYSTEM}" \
  305. --builder "ghcr.io/emqx/emqx-builder/5.0-8:${ELIXIR}-${OTP}-${SYSTEM}"
  306. done
  307. - uses: actions/upload-artifact@v1
  308. if: startsWith(github.ref, 'refs/tags/')
  309. with:
  310. name: ${{ matrix.profile }}-${{ matrix.otp }}
  311. path: source/_packages/${{ matrix.profile }}/.
  312. docker:
  313. runs-on: ${{ matrix.build_machine }}
  314. needs: prepare
  315. strategy:
  316. fail-fast: false
  317. matrix:
  318. os:
  319. - alpine3.14
  320. profile: # all editions for docker
  321. - emqx-edge
  322. - emqx
  323. - emqx-enterprise
  324. # NOTE: for docker, only support latest otp and elixir
  325. # versions, not a matrix
  326. otp:
  327. - 24.2.1-1 # update to latest
  328. elixir:
  329. - 1.13.3 # update to latest
  330. arch:
  331. - amd64
  332. - arm64
  333. build_elixir:
  334. - no_elixir
  335. build_machine:
  336. - aws-arm64
  337. - ubuntu-20.04
  338. exclude:
  339. - arch: arm64
  340. build_machine: ubuntu-20.04
  341. - arch: amd64
  342. build_machine: aws-arm64
  343. include:
  344. - os: alpine3.14
  345. profile: emqx
  346. otp: 24.2.1-1
  347. elixir: 1.13.3
  348. arch: amd64
  349. build_elixir: with_elixir
  350. build_machine: ubuntu-20.04
  351. steps:
  352. - uses: AutoModality/action-clean@v1
  353. if: matrix.build_machine == 'aws-arm64'
  354. - uses: actions/download-artifact@v2
  355. with:
  356. name: source
  357. path: .
  358. - name: unzip source code
  359. run: unzip -q source.zip
  360. - uses: docker/setup-buildx-action@v1
  361. - name: load quicer cache
  362. uses: actions/cache@v2
  363. with:
  364. path: |
  365. source/_build/default/lib/quicer/
  366. source/deps/quicer/
  367. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ needs.prepare.outputs.DEP_QUICER_REF }}
  368. - uses: docker/login-action@v1
  369. with:
  370. username: ${{ secrets.DOCKER_HUB_USER }}
  371. password: ${{ secrets.DOCKER_HUB_TOKEN }}
  372. - name: prepare for docker-action-parms
  373. id: pre-meta
  374. run: |
  375. img=$(echo ${{ matrix.os }} | sed 's#\([0-9.]\+\)$#:\1#g')
  376. emqx_name=${{ matrix.profile }}
  377. img_suffix=${{ matrix.arch }}
  378. img_labels="org.opencontainers.image.otp.version=${{ matrix.otp }}"
  379. if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
  380. emqx_name="emqx-elixir"
  381. img_suffix="elixir-${{ matrix.arch }}"
  382. img_labels="org.opencontainers.image.elixir.version=${{ matrix.elixir }}\n${img_labels}"
  383. fi
  384. echo "::set-output name=img::${img}"
  385. echo "::set-output name=emqx_name::${emqx_name}"
  386. echo "::set-output name=img_suffix::${img_suffix}"
  387. echo "::set-output name=img_labels::${img_labels}"
  388. # NOTE, Pls make sure this is identical as the one in job 'docker-push-multi-arch-manifest'
  389. - uses: docker/metadata-action@v3
  390. id: meta
  391. with:
  392. images: ${{ github.repository_owner }}/${{ matrix.profile }}
  393. flavor: |
  394. latest=${{ github.event_name == 'release' && !github.event.release.prerelease }}
  395. suffix=-${{ steps.pre-meta.outputs.img_suffix }}
  396. tags: |
  397. type=ref,event=branch
  398. type=ref,event=pr
  399. type=ref,event=tag
  400. type=semver,pattern={{version}}
  401. labels:
  402. ${{ steps.pre-meta.outputs.img_labels }}
  403. - uses: docker/build-push-action@v2
  404. with:
  405. push: >
  406. ${{ (github.event_name == 'release' && !github.event.release.prerelease)
  407. || (github.event.repository.owner != 'emqx' && startsWith(github.ref_name, 'ci/')) }}
  408. pull: true
  409. no-cache: true
  410. platforms: linux/${{ matrix.arch }}
  411. tags: ${{ steps.meta.outputs.tags }}
  412. labels: ${{ steps.meta.outputs.labels }}
  413. build-args: |
  414. BUILD_FROM=ghcr.io/emqx/emqx-builder/5.0-8:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}
  415. RUN_FROM=${{ steps.pre-meta.outputs.img }}
  416. EMQX_NAME=${{ steps.pre-meta.outputs.emqx_name }}
  417. file: source/deploy/docker/Dockerfile
  418. context: source
  419. - uses: aws-actions/configure-aws-credentials@v1
  420. if: matrix.profile == 'emqx'
  421. with:
  422. aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  423. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  424. aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
  425. - name: Docker push to aws ecr
  426. if: >
  427. ${{ (github.event_name == 'release' && !github.event.release.prerelease && matrix.profile == 'emqx')
  428. || (github.event.repository.owner != 'emqx' && startsWith(github.ref_name, 'ci/')) }}
  429. run: |
  430. aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
  431. for tag in $(echo ${{ steps.meta.outputs.json }} | jq -c '.tags[]'); do
  432. docker pull "$tag"
  433. docker tag "$tag" "public.ecr.aws/$tag"
  434. docker push "public.ecr.aws/$tag"
  435. done
  436. docker-push-multi-arch-manifest:
  437. # note, we only run on amd64
  438. if: >
  439. (github.event_name == 'release' && !github.event.release.prerelease)
  440. || (github.event.repository.owner != 'emqx' && startsWith(github.ref_name, 'ci/'))
  441. needs:
  442. - prepare
  443. - docker
  444. runs-on: ubuntu-latest
  445. strategy:
  446. fail-fast: false
  447. matrix:
  448. profile: # all editions for docker
  449. - emqx-edge
  450. - emqx
  451. - emqx-enterprise
  452. # NOTE: for docker, only support latest otp version, not a matrix
  453. otp:
  454. - 24.2.1-1 # update to latest
  455. #
  456. elixir:
  457. - 1.13.3 # update to latest
  458. arch:
  459. - amd64
  460. - arm64
  461. build_elixir:
  462. - no_elixir
  463. build_machine:
  464. - aws-arm64
  465. - ubuntu-20.04
  466. exclude:
  467. - arch: arm64
  468. build_machine: ubuntu-20.04
  469. - arch: amd64
  470. build_machine: aws-arm64
  471. include:
  472. - os: alpine3.14
  473. profile: emqx
  474. otp: 24.2.1-1
  475. elixir: 1.13.3
  476. arch: amd64
  477. build_elixir: with_elixir
  478. build_machine: ubuntu-20.04
  479. steps:
  480. - uses: actions/download-artifact@v2
  481. if: matrix.arch == 'amd64'
  482. with:
  483. name: source
  484. path: .
  485. - name: unzip source code
  486. if: matrix.arch == 'amd64'
  487. run: unzip -q source.zip
  488. - uses: docker/login-action@v1
  489. if: matrix.arch == 'amd64'
  490. with:
  491. username: ${{ secrets.DOCKER_HUB_USER }}
  492. password: ${{ secrets.DOCKER_HUB_TOKEN }}
  493. - name: prepare for docker-action-parms
  494. id: pre-meta
  495. run: |
  496. img=$(echo ${{ matrix.os }} | sed 's#\([0-9.]\+\)$#:\1#g')
  497. emqx_name=${{ matrix.profile }}
  498. img_suffix=${{ matrix.arch }}
  499. img_labels="org.opencontainers.image.otp.version=${{ matrix.otp }}"
  500. if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
  501. emqx_name="emqx-elixir"
  502. img_suffix="elixir-${{ matrix.arch }}"
  503. img_labels="org.opencontainers.image.elixir.version=${{ matrix.elixir }}\n$img_labels"
  504. fi
  505. echo "::set-output name=img::${img}"
  506. echo "::set-output name=emqx_name::${emqx_name}"
  507. echo "::set-output name=img_suffix::${img_suffix}"
  508. echo "::set-output name=img_labels::${img_labels}"
  509. # NOTE, Pls make sure this is identical as the one in job 'docker'
  510. - uses: docker/metadata-action@v3
  511. if: matrix.arch == 'amd64'
  512. id: meta
  513. with:
  514. images: ${{ github.repository_owner }}/${{ matrix.profile }}
  515. flavor: |
  516. latest=false
  517. suffix=-${{ steps.pre-meta.outputs.img_suffix }}
  518. tags: |
  519. type=ref,event=branch
  520. type=ref,event=pr
  521. type=ref,event=tag
  522. type=semver,pattern={{version}}
  523. labels:
  524. ${{ steps.pre-meta.outputs.img_labels }}
  525. - name: update manifest for multiarch image
  526. if: matrix.arch == 'amd64'
  527. working-directory: source
  528. run: |
  529. IsPushLatest=${{ github.event_name == 'release' && !github.event.release.prerelease }};
  530. scripts/docker-create-push-manifests.sh "${{ steps.meta.outputs.tags }}" "$IsPushLatest"
  531. - uses: aws-actions/configure-aws-credentials@v1
  532. if: matrix.profile == 'emqx' && matrix.arch == 'amd64'
  533. with:
  534. aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  535. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  536. aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
  537. - name: Docker push to aws ecr
  538. if: matrix.profile == 'emqx' && matrix.arch == 'amd64'
  539. run: |
  540. aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
  541. IsPushLatest=${{ github.event_name == 'release' && !github.event.release.prerelease }};
  542. scripts/docker-create-push-manifests.sh "public.ecr.aws/${{ steps.meta.outputs.tags }}" "$IsPushLatest"
  543. upload:
  544. runs-on: ubuntu-20.04
  545. if: startsWith(github.ref, 'refs/tags/')
  546. needs: [prepare, mac, linux, docker]
  547. strategy:
  548. fail-fast: false
  549. matrix:
  550. profile:
  551. - emqx-edge
  552. - emqx
  553. - emqx-enterprise
  554. otp:
  555. - 24.2.1-1
  556. include:
  557. - profile: emqx
  558. otp: windows # otp version on windows is rather fixed
  559. steps:
  560. - uses: actions/download-artifact@v2
  561. with:
  562. name: ${{ matrix.profile }}-${{ matrix.otp }}
  563. path: packages/${{ matrix.profile }}
  564. - name: install dos2unix
  565. run: sudo apt-get update && sudo apt install -y dos2unix
  566. - name: get packages
  567. run: |
  568. set -e -u
  569. cd packages/${{ matrix.profile }}
  570. for var in $( ls |grep emqx |grep -v sha256); do
  571. dos2unix $var.sha256
  572. echo "$(cat $var.sha256) $var" | sha256sum -c || exit 1
  573. done
  574. cd -
  575. - uses: aws-actions/configure-aws-credentials@v1
  576. with:
  577. aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  578. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  579. aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
  580. - name: upload aws s3
  581. env:
  582. PROFILE: ${{ matrix.profile }}
  583. run: |
  584. set -e -u
  585. if [ $PROFILE = 'emqx' ]; then
  586. s3dir='emqx-ce'
  587. elif [ $PROFILE = 'emqx-enterprise' ]; then
  588. s3dir='emqx-ee'
  589. elif [ $PROFILE = 'emqx-edge' ]; then
  590. s3dir='emqx-edge'
  591. else
  592. echo "unknown profile $PROFILE"
  593. exit 1
  594. fi
  595. aws s3 cp --recursive packages/$PROFILE s3://${{ secrets.AWS_S3_BUCKET }}/$s3dir/${{ github.ref_name }}
  596. aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_ID }} --paths "/$s3dir/${{ github.ref_name }}/*"