ci(build-cache): elixir build cache

This commit is contained in:
William Yang 2022-02-01 10:07:40 +01:00
parent 621d5a2efd
commit c9561478ac
2 changed files with 17 additions and 26 deletions

View File

@ -381,40 +381,32 @@ jobs:
PROFILE: ${{ matrix.profile }}
ARCH: ${{ matrix.arch }}
SYSTEM: ${{ matrix.os }}
if: ${{ matrix.build_elixir == 'no_elixir' }}
run: |
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
./scripts/buildx.sh \
--profile "${PROFILE}" \
--pkgtype "${PKGTYPE}" \
--arch "${ARCH}" \
--otp "${OTP}" \
--elixir "${ELIXIR}" \
--elixir "${ELIXIR}" "$WithElixir" \
--system "${SYSTEM}" \
--builder "ghcr.io/emqx/emqx-builder/5.0-5:${ELIXIR}-${OTP}-${SYSTEM}"
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
env:
@ -512,7 +504,7 @@ jobs:
if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
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}"
fi
echo "::set-output name=img::${img}"
@ -653,7 +645,7 @@ jobs:
if [ ${{ matrix.build_elixir }} = "with_elixir" ]; then
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"
fi
echo "::set-output name=img::${img}"

View File

@ -19,7 +19,6 @@ docker manifest push "${img_march}"
# PUSH latest if it is a release build
if [ "$IsPushLatest" = "true" ]; then
img_latest=$(echo "$img_arm64" | cut -d: -f 1):latest
docker manifest create "${img_latest}" \
--amend "$img_amd64_digest" \