diff --git a/.github/workflows/publish-deb.yml b/.github/workflows/publish-deb.yml index d7422cde6..480e25140 100644 --- a/.github/workflows/publish-deb.yml +++ b/.github/workflows/publish-deb.yml @@ -46,15 +46,20 @@ jobs: echo "##[error]Tag type is not correct, please check it." exit 1 - - name: Build apisix or apisix-base deb Package - if: ${{ env.TAG_TYPE == 'apisix' || env.TAG_TYPE == 'apisix-base' }} + - name: Build apisix-base deb Package + if: ${{ env.TAG_TYPE == 'apisix-base' }} run: | - echo build ${TAG_TYPE} deb package - echo version ${TAG_VERSION} - make package type=deb app=${TAG_TYPE} checkout=${TAG_VERSION} version=${TAG_VERSION} image_base=${VAR_OS} image_tag=${VAR_OS_RELEASE} openresty=apisix-base mv ./output/${TAG_TYPE}_${TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_amd64.deb ${VAR_DEB_WORKBENCH_DIR} + - name: Build apisix deb Package + if: ${{ env.TAG_TYPE == 'apisix' }} + run: | + wget https://raw.githubusercontent.com/apache/apisix/${TAG_VERSION}/.requirements && source .requirements + + make package type=deb app=${TAG_TYPE} checkout=${TAG_VERSION} version=${TAG_VERSION} image_base=${VAR_OS} image_tag=${VAR_OS_RELEASE} openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} + mv ./output/${TAG_TYPE}_${TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_amd64.deb ${VAR_DEB_WORKBENCH_DIR} + - name: Upload apisix/apisix-base Artifact uses: actions/upload-artifact@v2.2.3 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 191d1fbb5..32dedc0ec 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,10 +53,13 @@ jobs: env: APISIX_TAG_VERSION: ${{ steps.tag_env.outputs.version}} run: | + wget https://raw.githubusercontent.com/apache/apisix/${APISIX_TAG_VERSION}/.requirements + source .requirements + # build apisix - make package type=rpm app=apisix openresty=apisix-base checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=7 - make package type=rpm app=apisix openresty=apisix-base checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=8 - make package type=rpm app=apisix openresty=apisix-base checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 + make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=7 + make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=8 + make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 mv ./output/apisix-${APISIX_TAG_VERSION}-0.{el7,el8,ubi8.6}.x86_64.rpm ${VAR_RPM_WORKBENCH_DIR} echo "TARGET_APP=apisix" >> "$GITHUB_ENV" diff --git a/Makefile b/Makefile index bf6f51b2c..b926ef7e8 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ iteration=0 local_code_path=0 openresty="openresty" artifact="0" +runtime_version="0" apisix_repo="https://github.com/apache/apisix" dashboard_repo="https://github.com/apache/apisix-dashboard" @@ -103,6 +104,7 @@ define package --build-arg VERSION=$(version) \ --build-arg ITERATION=$(iteration) \ --build-arg PACKAGE_VERSION=$(version) \ + --build-arg RUNTIME_VERSION=$(runtime_version) \ --build-arg PACKAGE_TYPE=$(2) \ --build-arg OPENRESTY=$(openresty) \ --build-arg ARTIFACT=$(artifact) \ diff --git a/dockerfiles/Dockerfile.package.apisix b/dockerfiles/Dockerfile.package.apisix index 9315070bb..5c01da4ae 100644 --- a/dockerfiles/Dockerfile.package.apisix +++ b/dockerfiles/Dockerfile.package.apisix @@ -9,11 +9,13 @@ ARG PACKAGE_VERSION ARG PACKAGE_TYPE ARG OPENRESTY ARG ARTIFACT +ARG RUNTIME_VERSION ENV ITERATION=${ITERATION} ENV PACKAGE_VERSION=${PACKAGE_VERSION} ENV PACKAGE_TYPE=${PACKAGE_TYPE} ENV OPENRESTY=${OPENRESTY} +ENV RUNTIME_VERSION=${RUNTIME_VERSION} ENV ARTIFACT=${ARTIFACT} COPY --from=APISIX /tmp/build/output /tmp/build/output diff --git a/package-apisix.sh b/package-apisix.sh index 1f9a93e0f..099ec065e 100755 --- a/package-apisix.sh +++ b/package-apisix.sh @@ -56,7 +56,7 @@ then -a "$(uname -i)" \ -v "$PACKAGE_VERSION" \ --iteration "$ITERATION" \ - -d "$OPENRESTY == $VERSION" \ + -d "$OPENRESTY = $RUNTIME_VERSION" \ -d "$dep_ldap" \ -d "$dep_pcre" \ -d "$dep_which" \