build_packages.yaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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. release:
  9. types:
  10. - published
  11. workflow_dispatch:
  12. inputs:
  13. which_branch:
  14. required: false
  15. jobs:
  16. prepare:
  17. runs-on: ubuntu-20.04
  18. # prepare source with any OTP version, no need for a matrix
  19. # FIXME: use tagged version once merged
  20. container: "ghcr.io/emqx/emqx-builder/elixir:24.1.5-3-1.13.1-ubuntu20.04"
  21. outputs:
  22. ce_old_vsns: ${{ steps.find_old_versons.outputs.ce_old_vsns }}
  23. ee_old_vsns: ${{ steps.find_old_versons.outputs.ee_old_vsns }}
  24. steps:
  25. - uses: actions/checkout@v2
  26. with:
  27. ref: ${{ github.event.inputs.which_branch }}
  28. path: source
  29. fetch-depth: 0
  30. - name: find old versions
  31. id: find_old_versons
  32. shell: bash
  33. working-directory: source
  34. run: |
  35. ce_old_vsns="$(./scripts/relup-base-vsns.sh community | xargs)"
  36. ee_old_vsns="$(./scripts/relup-base-vsns.sh enterprise | xargs)"
  37. echo "::set-output name=ce_old_vsns::${ce_old_vsns}"
  38. echo "::set-output name=ee_old_vsns::${ee_old_vsns}"
  39. - name: get_all_deps
  40. run: |
  41. make -C source deps-all
  42. zip -ryq source.zip source/* source/.[^.]*
  43. - uses: actions/upload-artifact@v2
  44. with:
  45. name: source
  46. path: source.zip
  47. windows:
  48. runs-on: windows-2019
  49. needs: prepare
  50. strategy:
  51. fail-fast: false
  52. matrix:
  53. profile: # only CE for windows
  54. - emqx
  55. otp:
  56. ## gleam-lang/setup-erlang does not yet support the installation of otp24 on windows
  57. - 23.2
  58. steps:
  59. - uses: actions/download-artifact@v2
  60. with:
  61. name: source
  62. path: .
  63. - name: unzip source code
  64. run: Expand-Archive -Path source.zip -DestinationPath ./
  65. - uses: ilammy/msvc-dev-cmd@v1
  66. - uses: gleam-lang/setup-erlang@v1.1.2
  67. id: install_erlang
  68. with:
  69. otp-version: ${{ matrix.otp }}
  70. - name: build
  71. env:
  72. PYTHON: python
  73. DIAGNOSTIC: 1
  74. working-directory: source
  75. run: |
  76. $env:PATH = "${{ steps.install_erlang.outputs.erlpath }}\bin;$env:PATH"
  77. $version = $( "${{ github.ref }}" -replace "^(.*)/(.*)/" )
  78. if ($version -match "^v[0-9]+\.[0-9]+(\.[0-9]+)?") {
  79. $regex = "[0-9]+\.[0-9]+(-alpha|-beta|-rc)?\.[0-9]+"
  80. $pkg_name = "${{ matrix.profile }}-$([regex]::matches($version, $regex).value)-otp${{ matrix.otp }}-windows-amd64.tar.gz"
  81. }
  82. else {
  83. $pkg_name = "${{ matrix.profile }}-$($version -replace '/')-otp${{ matrix.otp }}-windows-amd64.tar.gz"
  84. }
  85. ## We do not build/release bcrypt and quic for windows package
  86. Remove-Item -Recurse -Force -Path _build/default/lib/bcrypt/
  87. Remove-Item -Recurse -Force -Path _build/default/lib/quicer/
  88. if (Test-Path rebar.lock) {
  89. Remove-Item -Force -Path rebar.lock
  90. }
  91. make ensure-rebar3
  92. copy rebar3 "${{ steps.install_erlang.outputs.erlpath }}\bin"
  93. ls "${{ steps.install_erlang.outputs.erlpath }}\bin"
  94. rebar3 --help
  95. make ${{ matrix.profile }}
  96. mkdir -p _packages/${{ matrix.profile }}
  97. Compress-Archive -Path _build/${{ matrix.profile }}/rel/emqx -DestinationPath _build/${{ matrix.profile }}/rel/$pkg_name
  98. mv _build/${{ matrix.profile }}/rel/$pkg_name _packages/${{ matrix.profile }}
  99. Get-FileHash -Path "_packages/${{ matrix.profile }}/$pkg_name" | Format-List | grep 'Hash' | awk '{print $3}' > _packages/${{ matrix.profile }}/$pkg_name.sha256
  100. - name: run emqx
  101. timeout-minutes: 1
  102. working-directory: source
  103. run: |
  104. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx start
  105. Start-Sleep -s 5
  106. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx stop
  107. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx install
  108. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx uninstall
  109. - uses: actions/upload-artifact@v1
  110. if: startsWith(github.ref, 'refs/tags/')
  111. with:
  112. name: ${{ matrix.profile }}
  113. path: source/_packages/${{ matrix.profile }}/.
  114. mac:
  115. needs: prepare
  116. strategy:
  117. fail-fast: false
  118. matrix:
  119. profile: # no EDGE for mac
  120. - emqx
  121. - emqx-enterprise
  122. otp:
  123. - 24.1.5-3
  124. macos:
  125. - macos-11
  126. - macos-10.15
  127. exclude:
  128. - profile: emqx-edge
  129. runs-on: ${{ matrix.macos }}
  130. steps:
  131. - uses: actions/download-artifact@v2
  132. with:
  133. name: source
  134. path: .
  135. - name: unzip source code
  136. run: unzip -q source.zip
  137. - name: prepare
  138. run: |
  139. brew update
  140. brew install curl zip unzip gnu-sed kerl unixodbc freetds
  141. echo "/usr/local/bin" >> $GITHUB_PATH
  142. git config --global credential.helper store
  143. - uses: actions/cache@v2
  144. id: cache
  145. with:
  146. path: ~/.kerl/${{ matrix.otp }}
  147. key: otp-install-${{ matrix.otp }}-${{ matrix.macos }}
  148. - name: build erlang
  149. if: steps.cache.outputs.cache-hit != 'true'
  150. timeout-minutes: 60
  151. env:
  152. KERL_BUILD_BACKEND: git
  153. OTP_GITHUB_URL: https://github.com/emqx/otp
  154. run: |
  155. kerl update releases
  156. kerl build ${{ matrix.otp }}
  157. kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }}
  158. - name: Get deps git refs for cache
  159. id: deps-refs
  160. run: |
  161. cd source
  162. . $HOME/.kerl/${{ matrix.otp }}/activate
  163. make ensure-rebar3
  164. sudo cp rebar3 /usr/local/bin/rebar3
  165. scripts/get-dep-refs.sh
  166. - name: load rocksdb cache
  167. uses: actions/cache@v2
  168. with:
  169. path: source/_build/default/lib/rocksdb/
  170. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_ROCKSDB_REF }}
  171. - name: load quicer cache
  172. uses: actions/cache@v2
  173. with:
  174. path: source/_build/default/lib/quicer/
  175. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_QUICER_REF }}
  176. - name: build
  177. working-directory: source
  178. run: |
  179. . $HOME/.kerl/${{ matrix.otp }}/activate
  180. make ensure-rebar3
  181. sudo cp rebar3 /usr/local/bin/rebar3
  182. rm -rf _build/${{ matrix.profile }}/lib
  183. make ${{ matrix.profile }}-tgz
  184. - name: test
  185. working-directory: source
  186. run: |
  187. pkg_name=$(find _packages/${{ matrix.profile }} -mindepth 1 -maxdepth 1 -iname \*.tar.gz)
  188. tar -zxf $pkg_name
  189. # gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins
  190. ./emqx/bin/emqx start || cat emqx/log/erlang.log.1
  191. ready='no'
  192. for i in {1..10}; do
  193. if curl -fs 127.0.0.1:18083/api/v5/status > /dev/null; then
  194. ready='yes'
  195. break
  196. fi
  197. sleep 1
  198. done
  199. if [ "$ready" != "yes" ]; then
  200. echo "Timed out waiting for emqx to be ready"
  201. cat emqx/log/erlang.log.1
  202. exit 1
  203. fi
  204. ./emqx/bin/emqx_ctl status
  205. ./emqx/bin/emqx stop
  206. rm -rf emqx
  207. openssl dgst -sha256 $pkg_name | awk '{print $2}' > $pkg_name.sha256
  208. - uses: actions/upload-artifact@v1
  209. if: startsWith(github.ref, 'refs/tags/')
  210. with:
  211. name: ${{ matrix.profile }}-${{ matrix.otp }}
  212. path: source/_packages/${{ matrix.profile }}/.
  213. linux:
  214. runs-on: ubuntu-20.04
  215. needs: prepare
  216. strategy:
  217. fail-fast: false
  218. matrix:
  219. profile: ## all editions for linux
  220. - emqx-edge
  221. - emqx
  222. - emqx-enterprise
  223. otp:
  224. - 24.1.5-3 # we test with OTP 23, but only build package on OTP 24 versions
  225. elixir:
  226. - 1.13.1
  227. arch:
  228. - amd64
  229. - arm64
  230. os:
  231. - ubuntu20.04
  232. - ubuntu18.04
  233. - ubuntu16.04
  234. - debian10
  235. - debian9
  236. # - opensuse
  237. - centos8
  238. - centos7
  239. - raspbian10
  240. # - raspbian9
  241. exclude:
  242. - os: raspbian9
  243. arch: amd64
  244. - os: raspbian10
  245. arch: amd64
  246. - os: raspbian9
  247. profile: emqx
  248. - os: raspbian10
  249. profile: emqx
  250. - os: raspbian9
  251. profile: emqx-enterprise
  252. - os: raspbian10
  253. profile: emqx-enterprise
  254. defaults:
  255. run:
  256. shell: bash
  257. steps:
  258. - uses: docker/setup-buildx-action@v1
  259. - uses: docker/setup-qemu-action@v1
  260. with:
  261. image: tonistiigi/binfmt:latest
  262. platforms: all
  263. - uses: actions/download-artifact@v2
  264. with:
  265. name: source
  266. path: .
  267. - name: unzip source code
  268. run: unzip -q source.zip
  269. - name: Get deps git refs for cache
  270. id: deps-refs
  271. run: |
  272. cd source
  273. scripts/get-dep-refs.sh
  274. - name: load rocksdb cache
  275. uses: actions/cache@v2
  276. with:
  277. path: source/_build/default/lib/rocksdb/
  278. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_ROCKSDB_REF }}
  279. - name: load quicer cache
  280. uses: actions/cache@v2
  281. with:
  282. path: source/_build/default/lib/quicer/
  283. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_QUICER_REF }}
  284. - name: download old emqx tgz packages
  285. env:
  286. OTP_VSN: ${{ matrix.otp }}
  287. PROFILE: ${{ matrix.profile }}
  288. ARCH: ${{ matrix.arch }}
  289. SYSTEM: ${{ matrix.os }}
  290. CE_OLD_VSNS: ${{ needs.prepare.outputs.ce_old_vsns }}
  291. EE_OLD_VSNS: ${{ needs.prepare.outputs.ee_old_vsns }}
  292. working-directory: source
  293. run: |
  294. set -e -x -u
  295. if [ $PROFILE = 'emqx' ]; then
  296. s3dir='emqx-ce'
  297. OLD_VSNS="$CE_OLD_VSNS"
  298. elif [ $PROFILE = 'emqx-enterprise' ]; then
  299. s3dir='emqx-ee'
  300. OLD_VSNS="$EE_OLD_VSNS"
  301. elif [ $PROFILE = 'emqx-edge' ]; then
  302. s3dir='emqx-edge'
  303. OLD_VSNS="$CE_OLD_VSNS"
  304. else
  305. echo "unknown profile $PROFILE"
  306. exit 1
  307. fi
  308. mkdir -p _upgrade_base
  309. cd _upgrade_base
  310. old_vsns=($(echo $OLD_VSNS | tr ' ' ' '))
  311. for tag in ${old_vsns[@]}; do
  312. package_name="${PROFILE}-${tag#[e|v]}-otp${OTP_VSN}-${SYSTEM}-${ARCH}"
  313. if [ ! -z "$(echo $(curl -I -m 10 -o /dev/null -s -w %{http_code} https://s3-us-west-2.amazonaws.com/packages.emqx/$s3dir/$tag/$package_name.tar.gz) | grep -oE "^[23]+")" ]; then
  314. wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$s3dir/$tag/$package_name.tar.gz
  315. wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$s3dir/$tag/$package_name.tar.gz.sha256
  316. echo "$(cat $package_name.tar.gz.sha256) $package_name.tar.gz" | sha256sum -c || exit 1
  317. fi
  318. done
  319. - name: build emqx packages
  320. env:
  321. OTP: ${{ matrix.otp }}
  322. ELIXIR: ${{ matrix.elixir }}
  323. PROFILE: ${{ matrix.profile }}
  324. ARCH: ${{ matrix.arch }}
  325. SYSTEM: ${{ matrix.os }}
  326. working-directory: source
  327. # FIXME: use tagged version once merged
  328. run: |
  329. ./scripts/buildx.sh \
  330. --profile "${PROFILE}" \
  331. --pkgtype "tgz" \
  332. --arch "${ARCH}" \
  333. --otp "${OTP}" \
  334. --elixir "${ELIXIR}" \
  335. --system "${SYSTEM}" \
  336. --builder "ghcr.io/emqx/emqx-builder/elixir:${OTP}-${ELIXIR}-${SYSTEM}"
  337. ## the pkg build is incremental on the tgz build
  338. ./scripts/buildx.sh \
  339. --profile "${PROFILE}" \
  340. --pkgtype "pkg" \
  341. --arch "${ARCH}" \
  342. --otp "${OTP}" \
  343. --elixir "${ELIXIR}" \
  344. --system "${SYSTEM}" \
  345. --builder "ghcr.io/emqx/emqx-builder/elixir:${OTP}-${ELIXIR}-${SYSTEM}"
  346. ./scripts/buildx.sh \
  347. --profile "${PROFILE}" \
  348. --pkgtype "elixirpkg" \
  349. --arch "${ARCH}" \
  350. --otp "${OTP}" \
  351. --elixir "${ELIXIR}" \
  352. --system "${SYSTEM}" \
  353. --builder "ghcr.io/emqx/emqx-builder/elixir:${OTP}-${ELIXIR}-${SYSTEM}"
  354. - name: create sha256
  355. env:
  356. PROFILE: ${{ matrix.profile}}
  357. working-directory: source
  358. run: |
  359. if [ -d _packages/$PROFILE ]; then
  360. cd _packages/$PROFILE
  361. for var in $(ls emqx-* ); do
  362. sudo bash -c "echo $(sha256sum $var | awk '{print $1}') > $var.sha256"
  363. done
  364. cd -
  365. fi
  366. - uses: actions/upload-artifact@v1
  367. if: startsWith(github.ref, 'refs/tags/')
  368. with:
  369. name: ${{ matrix.profile }}-${{ matrix.otp }}
  370. path: source/_packages/${{ matrix.profile }}/.
  371. docker:
  372. runs-on: ubuntu-20.04
  373. needs: prepare
  374. strategy:
  375. fail-fast: false
  376. matrix:
  377. profile: # all editions for docker
  378. - emqx-edge
  379. - emqx
  380. - emqx-enterprise
  381. # NOTE: for docker, only support latest otp and elixir
  382. # version, not a matrix
  383. otp:
  384. - 24.1.5-3 # update to latest
  385. elixir:
  386. - 1.13.1 # update to latest
  387. arch:
  388. - amd64
  389. - arm64
  390. steps:
  391. - uses: actions/download-artifact@v2
  392. with:
  393. name: source
  394. path: .
  395. - name: unzip source code
  396. run: unzip -q source.zip
  397. - uses: docker/setup-buildx-action@v1
  398. - uses: docker/setup-qemu-action@v1
  399. with:
  400. image: tonistiigi/binfmt:latest
  401. platforms: all
  402. - uses: docker/metadata-action@v3
  403. id: meta
  404. with:
  405. images: ${{ github.repository_owner }}/${{ matrix.profile }}
  406. flavor: |
  407. latest=${{ !github.event.release.prerelease }}
  408. tags: |
  409. type=ref,event=branch
  410. type=ref,event=pr
  411. type=ref,event=tag
  412. type=semver,pattern={{version}}
  413. labels:
  414. org.opencontainers.image.otp.version=${{ matrix.otp }}
  415. - uses: docker/login-action@v1
  416. if: github.event_name == 'release'
  417. with:
  418. username: ${{ secrets.DOCKER_HUB_USER }}
  419. password: ${{ secrets.DOCKER_HUB_TOKEN }}
  420. - uses: docker/build-push-action@v2
  421. with:
  422. push: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
  423. pull: true
  424. no-cache: true
  425. platforms: linux/amd64,linux/arm64
  426. tags: ${{ steps.meta.outputs.tags }}
  427. labels: ${{ steps.meta.outputs.labels }}
  428. build-args: |
  429. # FIXME: use tagged version once merged
  430. BUILD_FROM=ghcr.io/emqx/emqx-builder/elixir:${{ matrix.otp }}-${{ matrix.elixir }}-alpine3.14
  431. RUN_FROM=alpine:3.14
  432. EMQX_NAME=${{ matrix.profile }}
  433. file: source/deploy/docker/Dockerfile
  434. context: source
  435. - uses: aws-actions/configure-aws-credentials@v1
  436. if: github.event_name == 'release' && !github.event.release.prerelease && matrix.profile == 'emqx'
  437. with:
  438. aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  439. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  440. aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
  441. - name: Push image to aws ecr
  442. if: github.event_name == 'release' && !github.event.release.prerelease && matrix.profile == 'emqx'
  443. run: |
  444. version=${GITHUB_REF##*/}
  445. docker pull emqx/emqx:${version#v}
  446. docker tag emqx/emqx:${version#v} public.ecr.aws/emqx/emqx:${version#v}
  447. aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
  448. docker push public.ecr.aws/emqx/emqx:${version#v}
  449. delete-artifact:
  450. runs-on: ubuntu-20.04
  451. needs: [prepare, mac, linux, docker]
  452. steps:
  453. - uses: geekyeggo/delete-artifact@v1
  454. with:
  455. name: source
  456. upload:
  457. runs-on: ubuntu-20.04
  458. if: startsWith(github.ref, 'refs/tags/')
  459. needs: [prepare, mac, linux, docker]
  460. strategy:
  461. matrix:
  462. profile:
  463. - emqx-edge
  464. - emqx
  465. - emqx-enterprise
  466. otp:
  467. - 24.1.5-3
  468. steps:
  469. - uses: actions/checkout@v2
  470. - name: get_version
  471. run: |
  472. echo 'version<<EOF' >> $GITHUB_ENV
  473. echo ${{ github.ref }} | sed -r "s ^refs/heads/|^refs/tags/(.*) \1 g" >> $GITHUB_ENV
  474. echo 'EOF' >> $GITHUB_ENV
  475. - uses: actions/download-artifact@v2
  476. with:
  477. name: ${{ matrix.profile }}-${{ matrix.otp }}
  478. path: ./_packages/${{ matrix.profile }}
  479. - name: install dos2unix
  480. run: sudo apt-get update && sudo apt install -y dos2unix
  481. - name: get packages
  482. run: |
  483. set -e -u
  484. cd _packages/${{ matrix.profile }}
  485. for var in $( ls |grep emqx |grep -v sha256); do
  486. dos2unix $var.sha256
  487. echo "$(cat $var.sha256) $var" | sha256sum -c || exit 1
  488. done
  489. cd -
  490. - name: upload aws s3
  491. run: |
  492. set -e -u
  493. PROFILE=${{ matrix.profile }}
  494. if [ $PROFILE = 'emqx' ]; then
  495. s3dir='emqx-ce'
  496. elif [ $PROFILE = 'emqx-enterprise' ]; then
  497. s3dir='emqx-ee'
  498. elif [ $PROFILE = 'emqx-edge' ]; then
  499. s3dir='emqx-edge'
  500. else
  501. echo "unknown profile $PROFILE"
  502. exit 1
  503. fi
  504. aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
  505. aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  506. aws configure set default.region ${{ secrets.AWS_DEFAULT_REGION }}
  507. aws s3 cp --recursive _packages/${{ matrix.profile }} s3://${{ secrets.AWS_S3_BUCKET }}/$s3dir/${{ env.version }}
  508. aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_ID }} --paths "/$s3dir/${{ env.version }}/*"
  509. - uses: Rory-Z/upload-release-asset@v1
  510. if: github.event_name == 'release'
  511. with:
  512. repo: emqx
  513. path: "_packages/${{ matrix.profile }}/emqx-*"
  514. token: ${{ github.token }}
  515. - name: update to emqx.io
  516. if: github.event_name == 'release'
  517. run: |
  518. set -e -x -u
  519. curl -w %{http_code} \
  520. --insecure \
  521. -H "Content-Type: application/json" \
  522. -H "token: ${{ secrets.EMQX_IO_TOKEN }}" \
  523. -X POST \
  524. -d "{\"repo\":\"emqx/emqx\", \"tag\": \"${{ env.version }}\" }" \
  525. ${{ secrets.EMQX_IO_RELEASE_API }}
  526. - name: update repo.emqx.io
  527. if: github.event_name == 'release'
  528. run: |
  529. if [ "${{ matrix.profile }}" = 'emqx-enterprise' ]; then
  530. BOOL_FLAG_NAME="emqx_ee"
  531. else
  532. BOOL_FLAG_NAME="emqx_ce"
  533. fi
  534. curl --silent --show-error \
  535. -H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \
  536. -H "Accept: application/vnd.github.v3+json" \
  537. -X POST \
  538. -d "{\"ref\":\"v1.0.4\",\"inputs\":{\"version\": \"${{ env.version }}\", \"${BOOL_FLAG_NAME}\": \"true\"}}" \
  539. "https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_repos.yaml/dispatches"
  540. - name: update homebrew packages
  541. if: github.event_name == 'release' && matrix.profile == 'emqx'
  542. run: |
  543. if [ -z $(echo $version | grep -oE "(alpha|beta|rc)\.[0-9]") ]; then
  544. curl --silent --show-error \
  545. -H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \
  546. -H "Accept: application/vnd.github.v3+json" \
  547. -X POST \
  548. -d "{\"ref\":\"v1.0.4\",\"inputs\":{\"version\": \"${{ env.version }}\"}}" \
  549. "https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_homebrew.yaml/dispatches"
  550. fi
  551. - uses: geekyeggo/delete-artifact@v1
  552. with:
  553. name: ${{ matrix.profile }}