Merge pull request #8372 from zmstone/0701-fix-cross-build-ci

0701 fix cross build ci
This commit is contained in:
Zaiming (Stone) Shi 2022-07-01 06:46:01 +01:00 committed by GitHub
commit 2d9383842c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 8 deletions

View File

@ -23,6 +23,7 @@ on:
jobs: jobs:
prepare: prepare:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: ghcr.io/emqx/emqx-builder/5.0-17:1.13.4-24.2.1-1-ubuntu20.04
outputs: outputs:
BUILD_PROFILE: ${{ steps.get_profile.outputs.BUILD_PROFILE }} BUILD_PROFILE: ${{ steps.get_profile.outputs.BUILD_PROFILE }}
IS_EXACT_TAG: ${{ steps.get_profile.outputs.IS_EXACT_TAG }} IS_EXACT_TAG: ${{ steps.get_profile.outputs.IS_EXACT_TAG }}
@ -38,6 +39,7 @@ jobs:
id: get_profile id: get_profile
run: | run: |
cd source cd source
git config --global --add safe.directory "$(pwd)"
tag=${{ github.ref }} tag=${{ github.ref }}
if git describe --tags --match "[v|e]*" --exact; then if git describe --tags --match "[v|e]*" --exact; then
echo "This is an exact git tag, will publish release" echo "This is an exact git tag, will publish release"
@ -282,7 +284,7 @@ jobs:
elixir: 1.13.4 elixir: 1.13.4
build_elixir: with_elixir build_elixir: with_elixir
arch: amd64 arch: amd64
os: el7 os: el8
build_machine: ubuntu-20.04 build_machine: ubuntu-20.04
defaults: defaults:

View File

@ -37,8 +37,8 @@ jobs:
cd emqx cd emqx
ce_vsn="$(./pkg-vsn.sh opensource)" ce_vsn="$(./pkg-vsn.sh opensource)"
ee_vsn="$(./pkg-vsn.sh enterprise)" ee_vsn="$(./pkg-vsn.sh enterprise)"
old_ce_vsns="$(./scripts/relup-base-vsns.sh opensource | xargs)" old_ce_vsns="$(./scripts/relup-build/base-vsns.sh opensource | xargs)"
old_ee_vsns="$(./scripts/relup-base-vsns.sh enterprise | xargs)" old_ee_vsns="$(./scripts/relup-build/base-vsns.sh enterprise | xargs)"
old_vsns=$(echo -n "${old_ce_vsns} ${old_ee_vsns}" | sed 's/ $//g' | jq -R -s -c 'split(" ")') old_vsns=$(echo -n "${old_ce_vsns} ${old_ee_vsns}" | sed 's/ $//g' | jq -R -s -c 'split(" ")')
echo "::set-output name=CUR_CE_VSN::$ce_vsn" echo "::set-output name=CUR_CE_VSN::$ce_vsn"
echo "::set-output name=CUR_EE_VSN::$ee_vsn" echo "::set-output name=CUR_EE_VSN::$ee_vsn"

View File

@ -167,7 +167,7 @@ $(REL_PROFILES:%=%-rel) $(PKG_PROFILES:%=%-rel): $(COMMON_DEPS)
.PHONY: $(REL_PROFILES:%=%-relup-downloads) .PHONY: $(REL_PROFILES:%=%-relup-downloads)
define download-relup-packages define download-relup-packages
$1-relup-downloads: $1-relup-downloads:
@if [ "$${EMQX_RELUP}" = "true" ]; then $(CURDIR)/scripts/relup-base-packages.sh $1; fi @if [ "$${EMQX_RELUP}" = "true" ]; then $(CURDIR)/scripts/relup-build/download-base-packages.sh $1; fi
endef endef
ALL_ZIPS = $(REL_PROFILES) ALL_ZIPS = $(REL_PROFILES)
$(foreach zt,$(ALL_ZIPS),$(eval $(call download-relup-packages,$(zt)))) $(foreach zt,$(ALL_ZIPS),$(eval $(call download-relup-packages,$(zt))))

2
build
View File

@ -205,7 +205,7 @@ make_tgz() {
fi fi
$TAR zxf "${src_tarball}" -C "${tard}/emqx" $TAR zxf "${src_tarball}" -C "${tard}/emqx"
if [ -f "${tard}/emqx/releases/${PKG_VSN}/relup" ]; then if [ -f "${tard}/emqx/releases/${PKG_VSN}/relup" ]; then
./scripts/inject-relup.escript "${tard}/emqx/releases/${PKG_VSN}/relup" ./scripts/relup-build/inject-relup.escript "${tard}/emqx/releases/${PKG_VSN}/relup"
fi fi
## try to be portable for tar.gz packages. ## try to be portable for tar.gz packages.
## for DEB and RPM packages the dependencies are resoved by yum and apt ## for DEB and RPM packages the dependencies are resoved by yum and apt

View File

@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
# ensure dir # ensure dir
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.." cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/../.."
## This script prints the relup upgrade base versions ## This script prints the relup upgrade base versions
## for the given EMQX edition (specified as first arg) ## for the given EMQX edition (specified as first arg)

View File

@ -6,7 +6,7 @@ if [[ -n "$DEBUG" ]]; then set -x; fi
set -euo pipefail set -euo pipefail
# ensure dir # ensure dir
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.." cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/../.."
ROOT_DIR="$(pwd)" ROOT_DIR="$(pwd)"
PROFILE="${1:-emqx}" PROFILE="${1:-emqx}"
@ -37,7 +37,7 @@ case "$UNAME" in
;; ;;
esac esac
BASE_VERSIONS="$("${ROOT_DIR}"/scripts/relup-base-vsns.sh "$EDITION" | xargs echo -n)" BASE_VERSIONS="$("${ROOT_DIR}"/scripts/relup-build/base-vsns.sh "$EDITION" | xargs echo -n)"
fullvsn() { fullvsn() {
env PKG_VSN="$1" "${ROOT_DIR}"/pkg-vsn.sh "$PROFILE" --long env PKG_VSN="$1" "${ROOT_DIR}"/pkg-vsn.sh "$PROFILE" --long