-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3875c3
commit d279a59
Showing
2 changed files
with
9 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected] -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 {} \; | ||
|