ci(build-cache): elixir build cache
This commit is contained in:
parent
621d5a2efd
commit
c9561478ac
|
@ -381,40 +381,32 @@ jobs:
|
||||||
PROFILE: ${{ matrix.profile }}
|
PROFILE: ${{ matrix.profile }}
|
||||||
ARCH: ${{ matrix.arch }}
|
ARCH: ${{ matrix.arch }}
|
||||||
SYSTEM: ${{ matrix.os }}
|
SYSTEM: ${{ matrix.os }}
|
||||||
if: ${{ matrix.build_elixir == 'no_elixir' }}
|
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
for PKGTYPE in tgz pkg;
|
# Align path for CMake caches
|
||||||
|
if [ ! "$PWD" = "/emqx" ]; then
|
||||||
|
ln -s $PWD /emqx
|
||||||
|
cd /emqx
|
||||||
|
fi
|
||||||
|
echo "pwd is $PWD"
|
||||||
|
PkgTypes="tgz pkg"
|
||||||
|
WithElixir=""
|
||||||
|
if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
|
||||||
|
PkgTypes="tgz"
|
||||||
|
# set Elixir build flag
|
||||||
|
WithElixir="--with-elixir"
|
||||||
|
fi
|
||||||
|
for PKGTYPE in ${PkgTypes};
|
||||||
do
|
do
|
||||||
./scripts/buildx.sh \
|
./scripts/buildx.sh \
|
||||||
--profile "${PROFILE}" \
|
--profile "${PROFILE}" \
|
||||||
--pkgtype "${PKGTYPE}" \
|
--pkgtype "${PKGTYPE}" \
|
||||||
--arch "${ARCH}" \
|
--arch "${ARCH}" \
|
||||||
--otp "${OTP}" \
|
--otp "${OTP}" \
|
||||||
--elixir "${ELIXIR}" \
|
--elixir "${ELIXIR}" "$WithElixir" \
|
||||||
--system "${SYSTEM}" \
|
--system "${SYSTEM}" \
|
||||||
--builder "ghcr.io/emqx/emqx-builder/5.0-5:${ELIXIR}-${OTP}-${SYSTEM}"
|
--builder "ghcr.io/emqx/emqx-builder/5.0-5:${ELIXIR}-${OTP}-${SYSTEM}"
|
||||||
done
|
done
|
||||||
- name: build emqx packages (Elixir)
|
|
||||||
env:
|
|
||||||
OTP: ${{ matrix.otp }}
|
|
||||||
ELIXIR: ${{ matrix.elixir }}
|
|
||||||
PROFILE: ${{ matrix.profile }}
|
|
||||||
ARCH: ${{ matrix.arch }}
|
|
||||||
SYSTEM: ${{ matrix.os }}
|
|
||||||
working-directory: source
|
|
||||||
if: ${{ matrix.build_elixir == 'with_elixir' }}
|
|
||||||
run: |
|
|
||||||
## we currently only build tgzs for elixir
|
|
||||||
./scripts/buildx.sh \
|
|
||||||
--profile "${PROFILE}" \
|
|
||||||
--pkgtype "tgz" \
|
|
||||||
--arch "${ARCH}" \
|
|
||||||
--otp "${OTP}" \
|
|
||||||
--elixir "${ELIXIR}" \
|
|
||||||
--system "${SYSTEM}" \
|
|
||||||
--with-elixir \
|
|
||||||
--builder "ghcr.io/emqx/emqx-builder/5.0-5:${ELIXIR}-${OTP}-${SYSTEM}"
|
|
||||||
|
|
||||||
- name: create sha256
|
- name: create sha256
|
||||||
env:
|
env:
|
||||||
|
@ -512,7 +504,7 @@ jobs:
|
||||||
|
|
||||||
if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
|
if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
|
||||||
emqx_name="emqx-elixir"
|
emqx_name="emqx-elixir"
|
||||||
img_suffix="elixir-{{ matrix.arch }}"
|
img_suffix="elixir-${{ matrix.arch }}"
|
||||||
img_labels="org.opencontainers.image.elixir.version=${{ matrix.elixir }}\n${img_labels}"
|
img_labels="org.opencontainers.image.elixir.version=${{ matrix.elixir }}\n${img_labels}"
|
||||||
fi
|
fi
|
||||||
echo "::set-output name=img::${img}"
|
echo "::set-output name=img::${img}"
|
||||||
|
@ -653,7 +645,7 @@ jobs:
|
||||||
|
|
||||||
if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
|
if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
|
||||||
emqx_name="emqx-elixir"
|
emqx_name="emqx-elixir"
|
||||||
img_suffix="elixir-{{ matrix.arch }}"
|
img_suffix="elixir-${{ matrix.arch }}"
|
||||||
img_labels="org.opencontainers.image.elixir.version=${{ matrix.elixir }}\n$img_labels"
|
img_labels="org.opencontainers.image.elixir.version=${{ matrix.elixir }}\n$img_labels"
|
||||||
fi
|
fi
|
||||||
echo "::set-output name=img::${img}"
|
echo "::set-output name=img::${img}"
|
||||||
|
|
|
@ -19,7 +19,6 @@ docker manifest push "${img_march}"
|
||||||
|
|
||||||
# PUSH latest if it is a release build
|
# PUSH latest if it is a release build
|
||||||
if [ "$IsPushLatest" = "true" ]; then
|
if [ "$IsPushLatest" = "true" ]; then
|
||||||
|
|
||||||
img_latest=$(echo "$img_arm64" | cut -d: -f 1):latest
|
img_latest=$(echo "$img_arm64" | cut -d: -f 1):latest
|
||||||
docker manifest create "${img_latest}" \
|
docker manifest create "${img_latest}" \
|
||||||
--amend "$img_amd64_digest" \
|
--amend "$img_amd64_digest" \
|
||||||
|
|
Loading…
Reference in New Issue