@@ -111,15 +111,85 @@ jobs:
111111 api7/apisix-base:dev-x86_64
112112 docker manifest push api7/apisix-base:dev
113113
114+ build-and-publish-debian-arm64-package :
115+ machine :
116+ image : ubuntu-2004:202101-01
117+ resource_class : arm.medium
118+ environment :
119+ - VAR_DEB_WORKBENCH_DIR : /tmp/output
120+ - VAR_OS : debian
121+ - VAR_OS_RELEASE : bullseye-slim
122+
123+ steps :
124+ - checkout
125+ - run :
126+ name : Init basic publish env
127+ command : |
128+ mkdir -p "${VAR_DEB_WORKBENCH_DIR}"
129+ wget https://github.com/tencentyun/coscli/archive/refs/tags/v0.11.0-beta.tar.gz
130+ tar -zxvf v0.11.0-beta.tar.gz
131+ cd coscli-0.11.0-beta && go build
132+ sudo mv coscli ../
133+ cat \<< EOF > "${HOME}/.cos.yaml"
134+ cos:
135+ base:
136+ secretid: ${TENCENT_COS_SECRETID}
137+ secretkey: ${TENCENT_COS_SECRETKEY}
138+ protocol: https
139+ EOF
140+
141+ - when :
142+ condition :
143+ # enclose a pattern in ^ and $ to avoid accidental partial matches
144+ # https://circleci.com/docs/2.0/configuration-reference#logic-statements
145+ matches : { pattern: "^apisix/(.*)\\d+$", value: << pipeline.git.tag >> }
146+ steps :
147+ - run :
148+ name : build apisix deb package
149+ command : |
150+ APISIX_TAG_VERSION=$(echo ${CIRCLE_TAG##*/})
151+ echo "apisix version: $APISIX_TAG_VERSION"
152+ make package type=deb app=apisix openresty=apisix-base checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=${VAR_OS} image_tag=${VAR_OS_RELEASE}
153+ mv ./output/apisix_${APISIX_TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_arm64.deb ${VAR_DEB_WORKBENCH_DIR}
154+
155+ - run :
156+ name : upload deb package
157+ command : |
158+ find "${VAR_DEB_WORKBENCH_DIR}" -type f -name "apisix_*.deb" \
159+ -exec echo "upload : {}" \; \
160+ -exec sh -c 'file=$(basename {}); \
161+ ./coscli -e "${VAR_COS_ENDPOINT}" \
162+ cp --part-size 1000 {} "cos://${VAR_COS_BUCKET_REPO}/packages/arm64/debian/pool/main/a/apisix/${file}"' \;
163+
164+ - when :
165+ condition :
166+ matches : { pattern: "^apisix-base/(.*)\\d+$", value: << pipeline.git.tag >> }
167+ steps :
168+ - run :
169+ name : build apisix-base deb package
170+ command : |
171+ APISIX_BASE_TAG_VERSION=$(echo ${CIRCLE_TAG##*/})
172+ echo "apisix-base version: $APISIX_BASE_TAG_VERSION"
173+ make package type=deb app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=${VAR_OS} image_tag=${VAR_OS_RELEASE}
174+ mv ./output/apisix-base_${APISIX_BASE_TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_arm64.deb ${VAR_DEB_WORKBENCH_DIR}
175+ - run :
176+ name : upload deb package
177+ command : |
178+ find "${VAR_DEB_WORKBENCH_DIR}" -type f -name "apisix-base*.deb" \
179+ -exec echo "upload : {}" \; \
180+ -exec sh -c 'file=$(basename {}); \
181+ ./coscli -e "${VAR_COS_ENDPOINT}" \
182+ cp --part-size 1000 {} "cos://${VAR_COS_BUCKET_REPO}/packages/arm64/debian/pool/main/a/apisix-base/${file}"' \;
183+
114184# Invoke jobs via workflows
115185# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
116186workflows :
117187 build-apisix-base :
118188 jobs :
119189 - build :
120190 filters :
121- branches :
122- only : master
191+ branches :
192+ only : master
123193 build-and-push-apisix-base-dev :
124194 triggers :
125195 - schedule :
@@ -135,3 +205,9 @@ workflows:
135205 requires :
136206 - build-and-push-apisix-base-dev-arm
137207 - build-and-push-apisix-base-dev-x86
208+ build-and-publish-debian-package :
209+ jobs :
210+ - build-and-publish-debian-arm64-package :
211+ filters :
212+ tags :
213+ only : /^apisix.*/
0 commit comments