@@ -34,24 +34,29 @@ jobs:
3434 TAG_DATE=$(date +%Y%m%d)
3535 echo "TAG_DATE=${TAG_DATE}" >> "$GITHUB_ENV"
3636
37- - name : Extract Tags name
37+ - name : Extract Tags version
3838 if : ${{ startsWith(github.ref, 'refs/tags/') }}
39- id : tag_env
4039 shell : bash
4140 run : |
42- echo "##[set-output name=version;]$(echo $ {GITHUB_REF##*/}) "
41+ echo "TAG_VERSION=$ {GITHUB_REF##*/}" >> "$GITHUB_ENV "
4342
4443 - name : Extract Tags Type
4544 if : ${{ startsWith(github.ref, 'refs/tags/') }}
46- id : tag_type
4745 shell : bash
4846 run : |
49- echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/tags/})"
47+ type=$(echo ${GITHUB_REF} | awk -F '/' '{print $3}')
48+ echo "TAG_TYPE=${type}" >> "$GITHUB_ENV"
49+
50+ - name : Check Tags Type
51+ if : ${{ env.TAG_TYPE != 'apisix' && env.TAG_TYPE != 'apisix-base' && env.TAG_TYPE != 'dashboard' }}
52+ run : |
53+ echo "##[error]Tag type is not correct, or not support, please check it."
54+ exit 1
5055
5156 - name : Build apisix RPM Package
52- if : ${{ startsWith(steps.tag_type.outputs.version, 'apisix/') }}
57+ if : ${{ env.TAG_TYPE == 'apisix' }}
5358 env :
54- APISIX_TAG_VERSION : ${{ steps.tag_env.outputs.version }}
59+ APISIX_TAG_VERSION : ${{ env.TAG_VERSION }}
5560 run : |
5661 wget https://raw.githubusercontent.com/apache/apisix/${APISIX_TAG_VERSION}/.requirements
5762 source .requirements
@@ -64,37 +69,35 @@ jobs:
6469 echo "TARGET_APP=apisix" >> "$GITHUB_ENV"
6570
6671 - name : Build apisix-base RPM Package
67- if : ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }}
72+ if : ${{ env.TAG_TYPE == 'apisix-base' }}
6873 env :
69- APISIX_BASE_TAG_VERSION : ${{ steps.tag_env.outputs.version }}
74+ APISIX_BASE_TAG_VERSION : ${{ env.TAG_VERSION }}
7075 run : |
7176 # build apisix-base
72- echo ${{ steps.tag_env.outputs.version}}
73- echo ${{ steps.tag_type.outputs.version}}
77+ echo ${{ env.TAG_TYPE }} ${{ env.TAG_VERSION }}
7478 make package type=rpm app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=centos image_tag=7
7579 make package type=rpm app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=centos image_tag=8
7680 make package type=rpm app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6
7781 mv ./output/apisix-base-${APISIX_BASE_TAG_VERSION}-0.{el7,el8,ubi8.6}.x86_64.rpm ${VAR_RPM_WORKBENCH_DIR}
7882 echo "TARGET_APP=apisix-base" >> "$GITHUB_ENV"
7983
8084 - name : Build apisix-runtime RPM Package
81- if : ${{ startsWith(steps.tag_type.outputs.version, 'apisix-runtime/') }}
85+ if : ${{ env.TAG_TYPE == 'apisix-runtime' }}
8286 env :
83- APISIX_RUNTIME_TAG_VERSION : ${{ steps.tag_env.outputs.version }}
87+ APISIX_RUNTIME_TAG_VERSION : ${{ env.TAG_VERSION }}
8488 run : |
8589 # build apisix-runtime
86- echo ${{ steps.tag_env.outputs.version}}
87- echo ${{ steps.tag_type.outputs.version}}
90+ echo ${{ env.TAG_TYPE }} ${{ env.TAG_VERSION }}
8891 make package type=rpm app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=centos image_tag=7
8992 make package type=rpm app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=centos image_tag=8
9093 make package type=rpm app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6
9194 mv ./output/apisix-runtime-${APISIX_RUNTIME_TAG_VERSION}-0.{el7,el8,ubi8.6}.x86_64.rpm ${VAR_RPM_WORKBENCH_DIR}
9295 echo "TARGET_APP=apisix-runtime" >> "$GITHUB_ENV"
9396
9497 - name : Build apisix-dashboard RPM Package
95- if : ${{ startsWith(steps.tag_type.outputs.version, 'dashboard/') }}
98+ if : ${{ env.TAG_TYPE == 'dashboard' }}
9699 env :
97- APISIX_DASHBOARD_TAG_VERSION : ${{ steps.tag_env.outputs.version }}
100+ APISIX_DASHBOARD_TAG_VERSION : ${{ env.TAG_VERSION }}
98101 run : |
99102 # build apisix dashboard
100103 make package type=rpm app=dashboard checkout=${APISIX_DASHBOARD_TAG_VERSION} version=${APISIX_DASHBOARD_TAG_VERSION} image_base=centos image_tag=7
@@ -108,53 +111,67 @@ jobs:
108111 ls -al "${VAR_RPM_WORKBENCH_DIR}"
109112
110113 - name : Upload apisix Artifact for Redhat
111- if : ${{ startsWith(steps.tag_type.outputs.version, 'apisix/') }}
114+ if : ${{ env.TAG_TYPE == 'apisix' }}
112115116+ env :
117+ PACKAGE_NAME : apisix-${{ env.TAG_VERSION }}-0.ubi8.6.x86_64.rpm
113118 with :
114- name : " apisix-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm "
115- path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm "
119+ name : " ${PACKAGE_NAME} "
120+ path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME} "
116121
117122 - name : Upload apisix Artifact for Centos
118- if : ${{ startsWith(steps.tag_type.outputs.version, 'apisix/') }}
123+ if : ${{ env.TAG_TYPE == 'apisix' }}
119124125+ env :
126+ PACKAGE_NAME : apisix-${{ env.TAG_VERSION }}-0.el7.x86_64.rpm
120127 with :
121- name : " apisix-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm "
122- path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm "
128+ name : " ${PACKAGE_NAME} "
129+ path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME} "
123130
124131 - name : Upload apisix-base Artifact for Redhat
125- if : ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }}
132+ if : ${{ env.TAG_TYPE == 'apisix-base' }}
126133134+ env :
135+ PACKAGE_NAME : apisix-base-${{ env.TAG_VERSION }}-0.ubi8.6.x86_64.rpm
127136 with :
128- name : " apisix-base-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm "
129- path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-base-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm "
137+ name : " ${PACKAGE_NAME} "
138+ path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME} "
130139
131140 - name : Upload apisix-base Artifact for Centos
132- if : ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }}
141+ if : ${{ env.TAG_TYPE == 'apisix-base' }}
133142143+ env :
144+ PACKAGE_NAME : apisix-base-${{ env.TAG_VERSION }}-0.el7.x86_64.rpm
134145 with :
135- name : " apisix-base-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm "
136- path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-base-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm "
146+ name : " ${PACKAGE_NAME} "
147+ path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME} "
137148
138149 - name : Upload apisix-runtime Artifact for Redhat
139- if : ${{ startsWith(steps.tag_type.outputs.version, 'apisix-runtime/') }}
150+ if : ${{ env.TAG_TYPE == 'apisix-runtime' }}
140151152+ env :
153+ PACKAGE_NAME : apisix-runtime-${{ env.TAG_VERSION }}-0.ubi8.6.x86_64.rpm
141154 with :
142- name : " apisix-runtime-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm "
143- path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-runtime-${{ steps.tag_env.outputs.version}}-0.ubi8.6.x86_64.rpm "
155+ name : " ${PACKAGE_NAME} "
156+ path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME} "
144157
145158 - name : Upload apisix-runtime Artifact for Centos
146- if : ${{ startsWith(steps.tag_type.outputs.version, 'apisix-runtime/') }}
159+ if : ${{ env.TAG_TYPE == 'apisix-runtime' }}
147160161+ env :
162+ PACKAGE_NAME : apisix-runtime-${{ env.TAG_VERSION }}-0.el7.x86_64.rpm
148163 with :
149- name : " apisix-runtime-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm "
150- path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/apisix-runtime-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm "
164+ name : " ${PACKAGE_NAME} "
165+ path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME} "
151166
152167 - name : Upload apisix-dashboard Artifact
153- if : ${{ startsWith(steps.tag_type.outputs.version, 'dashboard/') }}
168+ if : ${{ env.TAG_TYPE == 'dashboard' }}
154169170+ env :
171+ PACKAGE_NAME : apisix-dashboard-${{ env.TAG_VERSION }}-0.el7.x86_64.rpm
155172 with :
156- name : " apisix-dashboard-${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm "
157- path : " ./apisix-dashboard- ${{ steps.tag_env.outputs.version}}-0.el7.x86_64.rpm "
173+ name : " ${PACKAGE_NAME} "
174+ path : " ${{ env.VAR_RPM_WORKBENCH_DIR }}/${PACKAGE_NAME} "
158175
159176 - name : RPM repo deps init
160177 env :
0 commit comments