diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 26a9af9e1..475a73878 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,15 +2,8 @@ name: Build and Publish RPM Package on: push: - branches: [ master ] tags: - - "v*" - paths-ignore: - - '*.md' - pull_request: - branches: [ master ] - paths-ignore: - - '*.md' + - "apisix/*" concurrency: group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }} @@ -56,18 +49,18 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags/') }} shell: bash run: | - echo "TAG_VERSION=3.10.0" >> "$GITHUB_ENV" + 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=apisix" >> "$GITHUB_ENV" + echo "TAG_TYPE=${type}" >> "$GITHUB_ENV" - name: Check Tags Type if: ${{ env.TAG_TYPE != 'apisix' && env.TAG_TYPE != 'apisix-base' && env.TAG_TYPE != 'dashboard' }} run: | - echo "##[error]Tag type is not correct, or not support, please check it." exit 1 @@ -76,12 +69,12 @@ jobs: env: APISIX_TAG_VERSION: ${{ env.TAG_VERSION }} run: | - wget https://raw.githubusercontent.com/apache/apisix/3.10.0/.requirements + wget https://raw.githubusercontent.com/apache/apisix/${APISIX_TAG_VERSION}/.requirements source .requirements # build apisix - make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=3.10.0 version=3.10.0 image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6 - mv ./output/apisix-3.10.0-0.ubi8.6.${ARCH}.rpm ${VAR_RPM_WORKBENCH_DIR} + 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.ubi8.6.${ARCH}.rpm ${VAR_RPM_WORKBENCH_DIR} echo "TARGET_APP=apisix" >> "$GITHUB_ENV" - name: Build apisix-base RPM Package @@ -124,7 +117,7 @@ jobs: if: ${{ env.TAG_TYPE == 'apisix' }} uses: actions/upload-artifact@v4.0.0 env: - PACKAGE_NAME: apisix-3.10.0-0.ubi8.6.${{ env.ARCH }}.rpm + PACKAGE_NAME: apisix-${{ env.TAG_VERSION }}-0.ubi8.6.${{ env.ARCH }}.rpm with: name: "${{ env.PACKAGE_NAME }}" path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${{ env.PACKAGE_NAME }}" @@ -184,10 +177,6 @@ jobs: run: | sudo -E ./utils/publish-rpm.sh repo_backup - - name: Setup tmate session - if: matrix.platform.arch == 'x86_64' - uses: mxschmitt/action-tmate@v3 - - name: RPM repo refresh for redhat run: | sudo -E ./utils/publish-rpm.sh repo_repodata_rebuild diff --git a/utils/publish-rpm.sh b/utils/publish-rpm.sh index 7d8afb1e0..ec2fde81a 100755 --- a/utils/publish-rpm.sh +++ b/utils/publish-rpm.sh @@ -24,7 +24,6 @@ VAR_COS_GLOBAL_REGION_DNS="cos.${COS_GLOBAL_REGION}.myqcloud.com" # GPG extension # ======================================= func_rpmsign_macros_init() { - echo "dibag" cat > ~/.rpmmacros <<_EOC_ # Macros for signing RPMs. %_signature gpg @@ -40,13 +39,6 @@ func_gpg_key_load() { # ${2} gpg key passphrase gpg --import --pinentry-mode loopback --batch --passphrase-file "${2}" "${1}" -gpg --list-keys --fingerprint - gpg --list-keys --fingerprint | grep "${GPG_MAIL}" -B 1 - gpg --list-keys --fingerprint | grep "${GPG_MAIL}" -B 1 | tr -d ' ' | - gpg --list-keys --fingerprint | grep "${GPG_MAIL}" -B 1 | tr -d ' ' | head -1 - gpg --list-keys --fingerprint | grep "${GPG_MAIL}" -B 1 | tr -d ' ' | head -1 | awk 'BEGIN { FS = "\n" } ; { print $1":6:" }' - gpg --list-keys --fingerprint | grep chenjunxu@api7.ai -B 1 | tr -d ' ' | head -1 | awk 'BEGIN { FS = "\n" } ; { print $1":6:" }' | gpg --import-ownertrust - gpg --list-keys --fingerprint | grep "${GPG_MAIL}" -B 1 \ | tr -d ' ' | head -1 | awk 'BEGIN { FS = "\n" } ; { print $1":6:" }' \ | gpg --import-ownertrust @@ -109,7 +101,7 @@ func_repo_repodata_sign() { # ${1} - repo parent path find "${1}" -type f -name "*repomd.xml" \ -exec echo "sign repodata for: {}" \; \ - -exec gpg --batch --yes --pinentry-mode loopback --passphrase-file "${VAR_GPG_PASSPHRASE}" --detach-sign --armor {} \; + -exec gpg --batch --pinentry-mode loopback --passphrase-file "${VAR_GPG_PASSPHRASE}" --detach-sign --armor {} \; } func_repo_upload() { @@ -169,8 +161,6 @@ rpm_gpg_sign) func_rpmsign_macros_init func_gpg_key_load "${VAR_GPG_PRIV_KET}" "${VAR_GPG_PASSPHRASE}" - echo "dibag key load done" - find "${VAR_RPM_WORKBENCH_DIR}" -type f -name "*.rpm" find "${VAR_RPM_WORKBENCH_DIR}" -type f -name "*.rpm" \ -exec echo "rpmsign for: {}" \; \ -exec rpmsign --addsign {} \;