From 5a6b3cd84a06e00ac387e9e4a46e613ef8857bca Mon Sep 17 00:00:00 2001 From: AlinsRan Date: Mon, 29 Jan 2024 05:36:13 +0800 Subject: [PATCH] test: ci arm upload --- .github/workflows/publish-deb-arm.yml | 76 +++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/publish-deb-arm.yml diff --git a/.github/workflows/publish-deb-arm.yml b/.github/workflows/publish-deb-arm.yml new file mode 100644 index 000000000..b7d9ad504 --- /dev/null +++ b/.github/workflows/publish-deb-arm.yml @@ -0,0 +1,76 @@ +name: Build and Publish DEB Package ARM + +on: + push: + +jobs: + publish_apisix: + name: Build and Publish deb Package + runs-on: buildjet-2vcpu-ubuntu-2204-arm + timeout-minutes: 60 + env: + VAR_DEB_WORKBENCH_DIR: /tmp/output + VAR_COS_BUCKET_REPO: ${{ secrets.VAR_COS_BUCKET_REPO }} + VAR_COS_BUCKET_CI: ${{ secrets.VAR_COS_BUCKET_CI }} + VAR_OS: debian + VAR_CODENAME: bullseye + VAR_OS_RELEASE: bullseye-slim + + steps: + - name: Check out code + uses: actions/checkout@v2.3.5 + with: + submodules: recursive + + - name: Init basic publish env + run: | + sudo apt-get update + mkdir -p "${VAR_DEB_WORKBENCH_DIR}" + + - name: Extract Tags version + if: ${{ startsWith(github.ref, 'refs/tags/') }} + shell: bash + run: | + echo "TAG_VERSION=${GITHUB_REF##*/}" >> "$GITHUB_ENV" + + - name: Extract Tags Type + if: ${{ startsWith(github.ref, 'refs/tags/') }} + shell: bash + run: | + type=$(echo ${GITHUB_REF} | awk -F '/' '{print $3}') + echo "TAG_TYPE=${type}" >> "$GITHUB_ENV" + + - name: Check Tags Type + if: ${{ env.TAG_TYPE != 'apisix' && env.TAG_TYPE != 'apisix-base' }} + run: | + echo "##[error]Tag type is not correct, or not support, please check it." + exit 1 + + - name: Build apisix-base deb Package + if: ${{ env.TAG_TYPE == 'apisix-base' }} + run: | + 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: Build apisix-runtime deb Package + if: ${{ env.TAG_TYPE == 'apisix-runtime' }} + 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-runtime + mv ./output/${TAG_TYPE}_${TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_amd64.deb ${VAR_DEB_WORKBENCH_DIR} + + - name: Upload apisix/apisix-runtime/apisix-base Artifact + uses: actions/upload-artifact@v4.0.0 + with: + name: "${{ env.TAG_TYPE }}_${{ env.TAG_VERSION }}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb" + path: "${{ env.VAR_DEB_WORKBENCH_DIR }}/${{ env.TAG_TYPE}}_${{ env.TAG_VERSION }}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb"