chore(autotest): build broker 5.0 packges
This commit is contained in:
parent
c05ecdbcb8
commit
167de6c975
|
@ -5,12 +5,13 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
push:
|
||||||
- cron: '0 */6 * * *'
|
# schedule:
|
||||||
release:
|
# - cron: '0 */6 * * *'
|
||||||
types:
|
# release:
|
||||||
- published
|
# types:
|
||||||
workflow_dispatch:
|
# - published
|
||||||
|
# workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
|
@ -71,77 +72,77 @@ jobs:
|
||||||
name: source-${{ steps.get_otp_version.outputs.otp }}
|
name: source-${{ steps.get_otp_version.outputs.otp }}
|
||||||
path: source-${{ steps.get_otp_version.outputs.otp }}.zip
|
path: source-${{ steps.get_otp_version.outputs.otp }}.zip
|
||||||
|
|
||||||
windows:
|
# windows:
|
||||||
runs-on: windows-2019
|
# runs-on: windows-2019
|
||||||
|
#
|
||||||
needs: prepare
|
# needs: prepare
|
||||||
if: endsWith(github.repository, 'emqx')
|
# if: endsWith(github.repository, 'emqx')
|
||||||
|
#
|
||||||
strategy:
|
# strategy:
|
||||||
fail-fast: false
|
# fail-fast: false
|
||||||
matrix:
|
# matrix:
|
||||||
profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
# profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
||||||
exclude:
|
# exclude:
|
||||||
- profile: emqx-edge
|
# - profile: emqx-edge
|
||||||
|
#
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/download-artifact@v2
|
# - uses: actions/download-artifact@v2
|
||||||
with:
|
# with:
|
||||||
name: source-23.2.7.2-emqx-2
|
# name: source-23.2.7.2-emqx-2
|
||||||
path: .
|
# path: .
|
||||||
- name: unzip source code
|
# - name: unzip source code
|
||||||
run: Expand-Archive -Path source-23.2.7.2-emqx-2.zip -DestinationPath ./
|
# run: Expand-Archive -Path source-23.2.7.2-emqx-2.zip -DestinationPath ./
|
||||||
- uses: ilammy/msvc-dev-cmd@v1
|
# - uses: ilammy/msvc-dev-cmd@v1
|
||||||
- uses: gleam-lang/setup-erlang@v1.1.2
|
# - uses: gleam-lang/setup-erlang@v1.1.2
|
||||||
id: install_erlang
|
# id: install_erlang
|
||||||
## gleam-lang/setup-erlang does not yet support the installation of otp24 on windows
|
# ## gleam-lang/setup-erlang does not yet support the installation of otp24 on windows
|
||||||
with:
|
# with:
|
||||||
otp-version: 23.2
|
# otp-version: 23.2
|
||||||
- name: build
|
# - name: build
|
||||||
env:
|
# env:
|
||||||
PYTHON: python
|
# PYTHON: python
|
||||||
DIAGNOSTIC: 1
|
# DIAGNOSTIC: 1
|
||||||
working-directory: source
|
# working-directory: source
|
||||||
run: |
|
# run: |
|
||||||
$env:PATH = "${{ steps.install_erlang.outputs.erlpath }}\bin;$env:PATH"
|
# $env:PATH = "${{ steps.install_erlang.outputs.erlpath }}\bin;$env:PATH"
|
||||||
|
#
|
||||||
$version = $( "${{ github.ref }}" -replace "^(.*)/(.*)/" )
|
# $version = $( "${{ github.ref }}" -replace "^(.*)/(.*)/" )
|
||||||
if ($version -match "^v[0-9]+\.[0-9]+(\.[0-9]+)?") {
|
# if ($version -match "^v[0-9]+\.[0-9]+(\.[0-9]+)?") {
|
||||||
$regex = "[0-9]+\.[0-9]+(-alpha|-beta|-rc)?\.[0-9]+"
|
# $regex = "[0-9]+\.[0-9]+(-alpha|-beta|-rc)?\.[0-9]+"
|
||||||
$pkg_name = "${{ matrix.profile }}-windows-$([regex]::matches($version, $regex).value).zip"
|
# $pkg_name = "${{ matrix.profile }}-windows-$([regex]::matches($version, $regex).value).zip"
|
||||||
}
|
# }
|
||||||
else {
|
# else {
|
||||||
$pkg_name = "${{ matrix.profile }}-windows-$($version -replace '/').zip"
|
# $pkg_name = "${{ matrix.profile }}-windows-$($version -replace '/').zip"
|
||||||
}
|
# }
|
||||||
## We do not build/release bcrypt and quic for windows package
|
# ## We do not build/release bcrypt and quic for windows package
|
||||||
Remove-Item -Recurse -Force -Path _build/default/lib/bcrypt/
|
# Remove-Item -Recurse -Force -Path _build/default/lib/bcrypt/
|
||||||
Remove-Item -Recurse -Force -Path _build/default/lib/quicer/
|
# Remove-Item -Recurse -Force -Path _build/default/lib/quicer/
|
||||||
if (Test-Path rebar.lock) {
|
# if (Test-Path rebar.lock) {
|
||||||
Remove-Item -Force -Path rebar.lock
|
# Remove-Item -Force -Path rebar.lock
|
||||||
}
|
# }
|
||||||
make ensure-rebar3
|
# make ensure-rebar3
|
||||||
copy rebar3 "${{ steps.install_erlang.outputs.erlpath }}\bin"
|
# copy rebar3 "${{ steps.install_erlang.outputs.erlpath }}\bin"
|
||||||
ls "${{ steps.install_erlang.outputs.erlpath }}\bin"
|
# ls "${{ steps.install_erlang.outputs.erlpath }}\bin"
|
||||||
rebar3 --help
|
# rebar3 --help
|
||||||
make ${{ matrix.profile }}
|
# make ${{ matrix.profile }}
|
||||||
mkdir -p _packages/${{ matrix.profile }}
|
# mkdir -p _packages/${{ matrix.profile }}
|
||||||
Compress-Archive -Path _build/${{ matrix.profile }}/rel/emqx -DestinationPath _build/${{ matrix.profile }}/rel/$pkg_name
|
# Compress-Archive -Path _build/${{ matrix.profile }}/rel/emqx -DestinationPath _build/${{ matrix.profile }}/rel/$pkg_name
|
||||||
mv _build/${{ matrix.profile }}/rel/$pkg_name _packages/${{ matrix.profile }}
|
# mv _build/${{ matrix.profile }}/rel/$pkg_name _packages/${{ matrix.profile }}
|
||||||
Get-FileHash -Path "_packages/${{ matrix.profile }}/$pkg_name" | Format-List | grep 'Hash' | awk '{print $3}' > _packages/${{ matrix.profile }}/$pkg_name.sha256
|
# Get-FileHash -Path "_packages/${{ matrix.profile }}/$pkg_name" | Format-List | grep 'Hash' | awk '{print $3}' > _packages/${{ matrix.profile }}/$pkg_name.sha256
|
||||||
- name: run emqx
|
# - name: run emqx
|
||||||
timeout-minutes: 1
|
# timeout-minutes: 1
|
||||||
working-directory: source
|
# working-directory: source
|
||||||
run: |
|
# run: |
|
||||||
./_build/${{ matrix.profile }}/rel/emqx/bin/emqx start
|
# ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx start
|
||||||
Start-Sleep -s 5
|
# Start-Sleep -s 5
|
||||||
./_build/${{ matrix.profile }}/rel/emqx/bin/emqx stop
|
# ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx stop
|
||||||
./_build/${{ matrix.profile }}/rel/emqx/bin/emqx install
|
# ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx install
|
||||||
./_build/${{ matrix.profile }}/rel/emqx/bin/emqx uninstall
|
# ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx uninstall
|
||||||
- uses: actions/upload-artifact@v1
|
# - uses: actions/upload-artifact@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
# if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
# with:
|
||||||
name: ${{ matrix.profile }}-23.2.7.2-emqx-2
|
# name: ${{ matrix.profile }}-23.2.7.2-emqx-2
|
||||||
path: source/_packages/${{ matrix.profile }}/.
|
# path: source/_packages/${{ matrix.profile }}/.
|
||||||
|
|
||||||
mac:
|
mac:
|
||||||
|
|
||||||
|
@ -222,296 +223,296 @@ jobs:
|
||||||
name: ${{ matrix.profile }}-${{ matrix.otp }}
|
name: ${{ matrix.profile }}-${{ matrix.otp }}
|
||||||
path: source/_packages/${{ matrix.profile }}/.
|
path: source/_packages/${{ matrix.profile }}/.
|
||||||
|
|
||||||
linux:
|
# linux:
|
||||||
runs-on: ubuntu-20.04
|
# runs-on: ubuntu-20.04
|
||||||
|
#
|
||||||
needs: prepare
|
# needs: prepare
|
||||||
|
#
|
||||||
strategy:
|
# strategy:
|
||||||
fail-fast: false
|
# fail-fast: false
|
||||||
matrix:
|
# matrix:
|
||||||
profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
# profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
||||||
os:
|
# os:
|
||||||
- ubuntu20.04
|
# - ubuntu20.04
|
||||||
- ubuntu18.04
|
# - ubuntu18.04
|
||||||
- ubuntu16.04
|
# - ubuntu16.04
|
||||||
- debian10
|
# - debian10
|
||||||
- debian9
|
# - debian9
|
||||||
# - opensuse
|
# # - opensuse
|
||||||
- centos8
|
# - centos8
|
||||||
- centos7
|
# - centos7
|
||||||
- centos6
|
# - centos6
|
||||||
- raspbian10
|
# - raspbian10
|
||||||
# - raspbian9
|
# # - raspbian9
|
||||||
arch:
|
# arch:
|
||||||
- amd64
|
# - amd64
|
||||||
- arm64
|
# - arm64
|
||||||
otp:
|
# otp:
|
||||||
- 23.2.7.2-emqx-2
|
# - 23.2.7.2-emqx-2
|
||||||
- 24.1.1-emqx-1
|
# - 24.1.1-emqx-1
|
||||||
exclude:
|
# exclude:
|
||||||
- os: centos6
|
# - os: centos6
|
||||||
arch: arm64
|
# arch: arm64
|
||||||
- os: raspbian9
|
# - os: raspbian9
|
||||||
arch: amd64
|
# arch: amd64
|
||||||
- os: raspbian10
|
# - os: raspbian10
|
||||||
arch: amd64
|
# arch: amd64
|
||||||
- os: raspbian9
|
# - os: raspbian9
|
||||||
profile: emqx
|
# profile: emqx
|
||||||
- os: raspbian10
|
# - os: raspbian10
|
||||||
profile: emqx
|
# profile: emqx
|
||||||
- os: raspbian9
|
# - os: raspbian9
|
||||||
profile: emqx-ee
|
# profile: emqx-ee
|
||||||
- os: raspbian10
|
# - os: raspbian10
|
||||||
profile: emqx-ee
|
# profile: emqx-ee
|
||||||
|
#
|
||||||
defaults:
|
# defaults:
|
||||||
run:
|
# run:
|
||||||
shell: bash
|
# shell: bash
|
||||||
|
#
|
||||||
steps:
|
# steps:
|
||||||
- uses: docker/setup-buildx-action@v1
|
# - uses: docker/setup-buildx-action@v1
|
||||||
- uses: docker/setup-qemu-action@v1
|
# - uses: docker/setup-qemu-action@v1
|
||||||
with:
|
# with:
|
||||||
image: tonistiigi/binfmt:latest
|
# image: tonistiigi/binfmt:latest
|
||||||
platforms: all
|
# platforms: all
|
||||||
- uses: actions/download-artifact@v2
|
# - uses: actions/download-artifact@v2
|
||||||
with:
|
# with:
|
||||||
name: source-${{ matrix.otp }}
|
# name: source-${{ matrix.otp }}
|
||||||
path: .
|
# path: .
|
||||||
- name: unzip source code
|
# - name: unzip source code
|
||||||
run: unzip -q source-${{ matrix.otp }}.zip
|
# run: unzip -q source-${{ matrix.otp }}.zip
|
||||||
- name: downloads old emqx zip packages
|
# - name: downloads old emqx zip packages
|
||||||
env:
|
# env:
|
||||||
PROFILE: ${{ matrix.profile }}
|
# PROFILE: ${{ matrix.profile }}
|
||||||
ARCH: ${{ matrix.arch }}
|
# ARCH: ${{ matrix.arch }}
|
||||||
SYSTEM: ${{ matrix.os }}
|
# SYSTEM: ${{ matrix.os }}
|
||||||
OLD_VSNS: ${{ needs.prepare.outputs.old_vsns }}
|
# OLD_VSNS: ${{ needs.prepare.outputs.old_vsns }}
|
||||||
working-directory: source
|
# working-directory: source
|
||||||
run: |
|
# run: |
|
||||||
set -e -x -u
|
# set -e -x -u
|
||||||
broker=$PROFILE
|
# broker=$PROFILE
|
||||||
if [ $PROFILE = "emqx" ];then
|
# if [ $PROFILE = "emqx" ];then
|
||||||
broker="emqx-ce"
|
# broker="emqx-ce"
|
||||||
fi
|
# fi
|
||||||
if [ ! -z "$(echo $SYSTEM | grep -oE 'raspbian')" ]; then
|
# if [ ! -z "$(echo $SYSTEM | grep -oE 'raspbian')" ]; then
|
||||||
export ARCH="arm"
|
# export ARCH="arm"
|
||||||
fi
|
# fi
|
||||||
|
#
|
||||||
mkdir -p _upgrade_base
|
# mkdir -p _upgrade_base
|
||||||
cd _upgrade_base
|
# cd _upgrade_base
|
||||||
old_vsns=($(echo $OLD_VSNS | tr ' ' ' '))
|
# old_vsns=($(echo $OLD_VSNS | tr ' ' ' '))
|
||||||
for tag in ${old_vsns[@]}; do
|
# for tag in ${old_vsns[@]}; do
|
||||||
if [ ! -z "$(echo $(curl -I -m 10 -o /dev/null -s -w %{http_code} https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip) | grep -oE "^[23]+")" ];then
|
# if [ ! -z "$(echo $(curl -I -m 10 -o /dev/null -s -w %{http_code} https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip) | grep -oE "^[23]+")" ];then
|
||||||
wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip
|
# wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip
|
||||||
wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip.sha256
|
# wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip.sha256
|
||||||
echo "$(cat $PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip.sha256) $PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip" | sha256sum -c || exit 1
|
# echo "$(cat $PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip.sha256) $PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip" | sha256sum -c || exit 1
|
||||||
fi
|
# fi
|
||||||
done
|
# done
|
||||||
- name: build emqx packages
|
# - name: build emqx packages
|
||||||
env:
|
# env:
|
||||||
OTP: ${{ matrix.otp }}
|
# OTP: ${{ matrix.otp }}
|
||||||
PROFILE: ${{ matrix.profile }}
|
# PROFILE: ${{ matrix.profile }}
|
||||||
ARCH: ${{ matrix.arch }}
|
# ARCH: ${{ matrix.arch }}
|
||||||
SYSTEM: ${{ matrix.os }}
|
# SYSTEM: ${{ matrix.os }}
|
||||||
working-directory: source
|
# working-directory: source
|
||||||
run: |
|
# run: |
|
||||||
docker run -i --rm \
|
# docker run -i --rm \
|
||||||
-v $(pwd):/emqx \
|
# -v $(pwd):/emqx \
|
||||||
--workdir /emqx \
|
# --workdir /emqx \
|
||||||
--platform linux/$ARCH \
|
# --platform linux/$ARCH \
|
||||||
ghcr.io/emqx/emqx-builder/5.0:$OTP-$SYSTEM \
|
# ghcr.io/emqx/emqx-builder/5.0:$OTP-$SYSTEM \
|
||||||
bash -euc "make $PROFILE-zip || cat rebar3.crashdump; \
|
# bash -euc "make $PROFILE-zip || cat rebar3.crashdump; \
|
||||||
make $PROFILE-pkg || cat rebar3.crashdump; \
|
# make $PROFILE-pkg || cat rebar3.crashdump; \
|
||||||
EMQX_NAME=$PROFILE && .ci/build_packages/tests.sh"
|
# EMQX_NAME=$PROFILE && .ci/build_packages/tests.sh"
|
||||||
- name: create sha256
|
# - name: create sha256
|
||||||
env:
|
# env:
|
||||||
PROFILE: ${{ matrix.profile}}
|
# PROFILE: ${{ matrix.profile}}
|
||||||
working-directory: source
|
# working-directory: source
|
||||||
run: |
|
# run: |
|
||||||
if [ -d _packages/$PROFILE ]; then
|
# if [ -d _packages/$PROFILE ]; then
|
||||||
cd _packages/$PROFILE
|
# cd _packages/$PROFILE
|
||||||
for var in $(ls emqx-* ); do
|
# for var in $(ls emqx-* ); do
|
||||||
sudo bash -c "echo $(sha256sum $var | awk '{print $1}') > $var.sha256"
|
# sudo bash -c "echo $(sha256sum $var | awk '{print $1}') > $var.sha256"
|
||||||
done
|
# done
|
||||||
cd -
|
# cd -
|
||||||
fi
|
# fi
|
||||||
- uses: actions/upload-artifact@v1
|
# - uses: actions/upload-artifact@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
# if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
# with:
|
||||||
name: ${{ matrix.profile }}-${{ matrix.otp }}
|
# name: ${{ matrix.profile }}-${{ matrix.otp }}
|
||||||
path: source/_packages/${{ matrix.profile }}/.
|
# path: source/_packages/${{ matrix.profile }}/.
|
||||||
|
#
|
||||||
docker:
|
# docker:
|
||||||
runs-on: ubuntu-20.04
|
# runs-on: ubuntu-20.04
|
||||||
needs: prepare
|
# needs: prepare
|
||||||
|
#
|
||||||
strategy:
|
# strategy:
|
||||||
fail-fast: false
|
# fail-fast: false
|
||||||
matrix:
|
# matrix:
|
||||||
profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
# profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
||||||
otp:
|
# otp:
|
||||||
- 24.1.1-emqx-1
|
# - 24.1.1-emqx-1
|
||||||
|
#
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/download-artifact@v2
|
# - uses: actions/download-artifact@v2
|
||||||
with:
|
# with:
|
||||||
name: source-${{ matrix.otp }}
|
# name: source-${{ matrix.otp }}
|
||||||
path: .
|
# path: .
|
||||||
- name: unzip source code
|
# - name: unzip source code
|
||||||
run: unzip -q source-${{ matrix.otp }}.zip
|
# run: unzip -q source-${{ matrix.otp }}.zip
|
||||||
- uses: docker/setup-buildx-action@v1
|
# - uses: docker/setup-buildx-action@v1
|
||||||
- uses: docker/setup-qemu-action@v1
|
# - uses: docker/setup-qemu-action@v1
|
||||||
with:
|
# with:
|
||||||
image: tonistiigi/binfmt:latest
|
# image: tonistiigi/binfmt:latest
|
||||||
platforms: all
|
# platforms: all
|
||||||
- uses: docker/metadata-action@v3
|
# - uses: docker/metadata-action@v3
|
||||||
id: meta
|
# id: meta
|
||||||
with:
|
# with:
|
||||||
images: ${{ github.repository_owner }}/${{ matrix.profile }}
|
# images: ${{ github.repository_owner }}/${{ matrix.profile }}
|
||||||
flavor: |
|
# flavor: |
|
||||||
latest=${{ !github.event.release.prerelease }}
|
# latest=${{ !github.event.release.prerelease }}
|
||||||
tags: |
|
# tags: |
|
||||||
type=ref,event=branch
|
# type=ref,event=branch
|
||||||
type=ref,event=pr
|
# type=ref,event=pr
|
||||||
type=ref,event=tag
|
# type=ref,event=tag
|
||||||
type=semver,pattern={{version}}
|
# type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
# type=semver,pattern={{major}}.{{minor}}
|
||||||
- uses: docker/login-action@v1
|
# - uses: docker/login-action@v1
|
||||||
if: github.event_name == 'release'
|
# if: github.event_name == 'release'
|
||||||
with:
|
# with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
# username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
# password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
- uses: docker/build-push-action@v2
|
# - uses: docker/build-push-action@v2
|
||||||
with:
|
# with:
|
||||||
push: ${{ github.event_name == 'release' }}
|
# push: ${{ github.event_name == 'release' }}
|
||||||
pull: true
|
# pull: true
|
||||||
no-cache: true
|
# no-cache: true
|
||||||
platforms: linux/amd64,linux/arm64
|
# platforms: linux/amd64,linux/arm64
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
# tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
# labels: ${{ steps.meta.outputs.labels }}
|
||||||
build-args: |
|
# build-args: |
|
||||||
BUILD_FROM=ghcr.io/emqx/emqx-builder/5.0:${{ matrix.otp }}-alpine3.14
|
# BUILD_FROM=ghcr.io/emqx/emqx-builder/5.0:${{ matrix.otp }}-alpine3.14
|
||||||
RUN_FROM=alpine:3.14
|
# RUN_FROM=alpine:3.14
|
||||||
EMQX_NAME=${{ matrix.profile }}
|
# EMQX_NAME=${{ matrix.profile }}
|
||||||
file: source/deploy/docker/Dockerfile
|
# file: source/deploy/docker/Dockerfile
|
||||||
context: source
|
# context: source
|
||||||
|
#
|
||||||
delete-artifact:
|
# delete-artifact:
|
||||||
|
#
|
||||||
runs-on: ubuntu-20.04
|
# runs-on: ubuntu-20.04
|
||||||
strategy:
|
# strategy:
|
||||||
matrix:
|
# matrix:
|
||||||
otp:
|
# otp:
|
||||||
- 23.2.7.2-emqx-2
|
# - 23.2.7.2-emqx-2
|
||||||
- 24.1.1-emqx-1
|
# - 24.1.1-emqx-1
|
||||||
needs: [prepare, mac, linux, docker]
|
# needs: [prepare, mac, linux, docker]
|
||||||
steps:
|
# steps:
|
||||||
- uses: geekyeggo/delete-artifact@v1
|
# - uses: geekyeggo/delete-artifact@v1
|
||||||
with:
|
# with:
|
||||||
name: source-${{ matrix.otp }}
|
# name: source-${{ matrix.otp }}
|
||||||
|
#
|
||||||
upload:
|
# upload:
|
||||||
runs-on: ubuntu-20.04
|
# runs-on: ubuntu-20.04
|
||||||
|
#
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
# if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
#
|
||||||
needs: [prepare, mac, linux, docker]
|
# needs: [prepare, mac, linux, docker]
|
||||||
|
#
|
||||||
strategy:
|
# strategy:
|
||||||
matrix:
|
# matrix:
|
||||||
profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
# profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
||||||
otp:
|
# otp:
|
||||||
- 24.1.1-emqx-1
|
# - 24.1.1-emqx-1
|
||||||
|
#
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/checkout@v2
|
# - uses: actions/checkout@v2
|
||||||
- name: get_version
|
# - name: get_version
|
||||||
run: |
|
# run: |
|
||||||
echo 'version<<EOF' >> $GITHUB_ENV
|
# echo 'version<<EOF' >> $GITHUB_ENV
|
||||||
echo ${{ github.ref }} | sed -r "s ^refs/heads/|^refs/tags/(.*) \1 g" >> $GITHUB_ENV
|
# echo ${{ github.ref }} | sed -r "s ^refs/heads/|^refs/tags/(.*) \1 g" >> $GITHUB_ENV
|
||||||
echo 'EOF' >> $GITHUB_ENV
|
# echo 'EOF' >> $GITHUB_ENV
|
||||||
- uses: actions/download-artifact@v2
|
# - uses: actions/download-artifact@v2
|
||||||
with:
|
# with:
|
||||||
name: ${{ matrix.profile }}-${{ matrix.otp }}
|
# name: ${{ matrix.profile }}-${{ matrix.otp }}
|
||||||
path: ./_packages/${{ matrix.profile }}
|
# path: ./_packages/${{ matrix.profile }}
|
||||||
- name: install dos2unix
|
# - name: install dos2unix
|
||||||
run: sudo apt-get update && sudo apt install -y dos2unix
|
# run: sudo apt-get update && sudo apt install -y dos2unix
|
||||||
- name: get packages
|
# - name: get packages
|
||||||
run: |
|
# run: |
|
||||||
set -e -u
|
# set -e -u
|
||||||
cd _packages/${{ matrix.profile }}
|
# cd _packages/${{ matrix.profile }}
|
||||||
for var in $( ls |grep emqx |grep -v sha256); do
|
# for var in $( ls |grep emqx |grep -v sha256); do
|
||||||
dos2unix $var.sha256
|
# dos2unix $var.sha256
|
||||||
echo "$(cat $var.sha256) $var" | sha256sum -c || exit 1
|
# echo "$(cat $var.sha256) $var" | sha256sum -c || exit 1
|
||||||
done
|
# done
|
||||||
cd -
|
# cd -
|
||||||
- name: upload aws s3
|
# - name: upload aws s3
|
||||||
run: |
|
# run: |
|
||||||
set -e -u
|
# set -e -u
|
||||||
if [ "${{ matrix.profile }}" == "emqx" ];then
|
# if [ "${{ matrix.profile }}" == "emqx" ];then
|
||||||
broker="emqx-ce"
|
# broker="emqx-ce"
|
||||||
else
|
# else
|
||||||
broker=${{ matrix.profile }}
|
# broker=${{ matrix.profile }}
|
||||||
fi
|
# fi
|
||||||
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
|
# aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
# aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws configure set default.region ${{ secrets.AWS_DEFAULT_REGION }}
|
# aws configure set default.region ${{ secrets.AWS_DEFAULT_REGION }}
|
||||||
|
#
|
||||||
aws s3 cp --recursive _packages/${{ matrix.profile }} s3://${{ secrets.AWS_S3_BUCKET }}/$broker/${{ env.version }}
|
# aws s3 cp --recursive _packages/${{ matrix.profile }} s3://${{ secrets.AWS_S3_BUCKET }}/$broker/${{ env.version }}
|
||||||
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_ID }} --paths "/$broker/${{ env.version }}/*"
|
# aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_ID }} --paths "/$broker/${{ env.version }}/*"
|
||||||
- uses: Rory-Z/upload-release-asset@v1
|
# - uses: Rory-Z/upload-release-asset@v1
|
||||||
if: github.event_name == 'release' && matrix.profile != 'emqx-ee'
|
# if: github.event_name == 'release' && matrix.profile != 'emqx-ee'
|
||||||
with:
|
# with:
|
||||||
repo: emqx
|
# repo: emqx
|
||||||
path: "_packages/${{ matrix.profile }}/emqx-*"
|
# path: "_packages/${{ matrix.profile }}/emqx-*"
|
||||||
token: ${{ github.token }}
|
# token: ${{ github.token }}
|
||||||
- uses: Rory-Z/upload-release-asset@v1
|
# - uses: Rory-Z/upload-release-asset@v1
|
||||||
if: github.event_name == 'release' && matrix.profile == 'emqx-ee'
|
# if: github.event_name == 'release' && matrix.profile == 'emqx-ee'
|
||||||
with:
|
# with:
|
||||||
repo: emqx-enterprise
|
# repo: emqx-enterprise
|
||||||
path: "_packages/${{ matrix.profile }}/emqx-*"
|
# path: "_packages/${{ matrix.profile }}/emqx-*"
|
||||||
token: ${{ github.token }}
|
# token: ${{ github.token }}
|
||||||
- name: update to emqx.io
|
# - name: update to emqx.io
|
||||||
if: github.event_name == 'release'
|
# if: github.event_name == 'release'
|
||||||
run: |
|
# run: |
|
||||||
set -e -x -u
|
# set -e -x -u
|
||||||
curl -w %{http_code} \
|
# curl -w %{http_code} \
|
||||||
--insecure \
|
# --insecure \
|
||||||
-H "Content-Type: application/json" \
|
# -H "Content-Type: application/json" \
|
||||||
-H "token: ${{ secrets.EMQX_IO_TOKEN }}" \
|
# -H "token: ${{ secrets.EMQX_IO_TOKEN }}" \
|
||||||
-X POST \
|
# -X POST \
|
||||||
-d "{\"repo\":\"emqx/emqx\", \"tag\": \"${{ env.version }}\" }" \
|
# -d "{\"repo\":\"emqx/emqx\", \"tag\": \"${{ env.version }}\" }" \
|
||||||
${{ secrets.EMQX_IO_RELEASE_API }}
|
# ${{ secrets.EMQX_IO_RELEASE_API }}
|
||||||
- name: update repo.emqx.io
|
# - name: update repo.emqx.io
|
||||||
if: github.event_name == 'release' && endsWith(github.repository, 'enterprise') && matrix.profile == 'emqx-ee'
|
# if: github.event_name == 'release' && endsWith(github.repository, 'enterprise') && matrix.profile == 'emqx-ee'
|
||||||
run: |
|
# run: |
|
||||||
curl --silent --show-error \
|
# curl --silent --show-error \
|
||||||
-H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \
|
# -H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
# -H "Accept: application/vnd.github.v3+json" \
|
||||||
-X POST \
|
# -X POST \
|
||||||
-d "{\"ref\":\"v1.0.3\",\"inputs\":{\"version\": \"${{ env.version }}\", \"emqx_ee\": \"true\"}}" \
|
# -d "{\"ref\":\"v1.0.3\",\"inputs\":{\"version\": \"${{ env.version }}\", \"emqx_ee\": \"true\"}}" \
|
||||||
"https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_repos.yaml/dispatches"
|
# "https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_repos.yaml/dispatches"
|
||||||
- name: update repo.emqx.io
|
# - name: update repo.emqx.io
|
||||||
if: github.event_name == 'release' && endsWith(github.repository, 'emqx') && matrix.profile == 'emqx'
|
# if: github.event_name == 'release' && endsWith(github.repository, 'emqx') && matrix.profile == 'emqx'
|
||||||
run: |
|
# run: |
|
||||||
curl --silent --show-error \
|
# curl --silent --show-error \
|
||||||
-H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \
|
# -H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
# -H "Accept: application/vnd.github.v3+json" \
|
||||||
-X POST \
|
# -X POST \
|
||||||
-d "{\"ref\":\"v1.0.3\",\"inputs\":{\"version\": \"${{ env.version }}\", \"emqx_ce\": \"true\"}}" \
|
# -d "{\"ref\":\"v1.0.3\",\"inputs\":{\"version\": \"${{ env.version }}\", \"emqx_ce\": \"true\"}}" \
|
||||||
"https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_repos.yaml/dispatches"
|
# "https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_repos.yaml/dispatches"
|
||||||
- name: update homebrew packages
|
# - name: update homebrew packages
|
||||||
if: github.event_name == 'release' && endsWith(github.repository, 'emqx') && matrix.profile == 'emqx'
|
# if: github.event_name == 'release' && endsWith(github.repository, 'emqx') && matrix.profile == 'emqx'
|
||||||
run: |
|
# run: |
|
||||||
if [ -z $(echo $version | grep -oE "(alpha|beta|rc)\.[0-9]") ]; then
|
# if [ -z $(echo $version | grep -oE "(alpha|beta|rc)\.[0-9]") ]; then
|
||||||
curl --silent --show-error \
|
# curl --silent --show-error \
|
||||||
-H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \
|
# -H "Authorization: token ${{ secrets.CI_GIT_TOKEN }}" \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
# -H "Accept: application/vnd.github.v3+json" \
|
||||||
-X POST \
|
# -X POST \
|
||||||
-d "{\"ref\":\"v1.0.3\",\"inputs\":{\"version\": \"${{ env.version }}\"}}" \
|
# -d "{\"ref\":\"v1.0.3\",\"inputs\":{\"version\": \"${{ env.version }}\"}}" \
|
||||||
"https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_homebrew.yaml/dispatches"
|
# "https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_homebrew.yaml/dispatches"
|
||||||
fi
|
# fi
|
||||||
- uses: geekyeggo/delete-artifact@v1
|
# - uses: geekyeggo/delete-artifact@v1
|
||||||
with:
|
# with:
|
||||||
name: ${{ matrix.profile }}
|
# name: ${{ matrix.profile }}
|
||||||
|
|
Loading…
Reference in New Issue