Skip to content

Commit

Permalink
test upload releasle file cloud object stroage
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Dec 17, 2024
1 parent 0ba22aa commit bc2e161
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 24 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/auto-cache-pool-tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,3 @@ jobs:
files: |
all-deps.zip
all-deps.zip.sha256sum
- name: uploade artifacts to cloud object strage
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
run: |
bash sapi/scripts/tencentyun-upload-cloud-object-storage.sh
8 changes: 8 additions & 0 deletions .github/workflows/linux-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,11 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: swoole-cli-v${{ env.APP_VERSION }}-linux-arm64.tar.xz

- name: uploade artifacts to cloud object storage
if: startsWith(github.ref, 'refs/tags/v')
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
run: |
bash sapi/scripts/tencentyun-upload-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip
8 changes: 8 additions & 0 deletions .github/workflows/linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,11 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: swoole-cli-v${{ env.APP_VERSION }}-linux-x64.tar.xz

- name: uploade artifacts to cloud object storage
if: startsWith(github.ref, 'refs/tags/v')
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
run: |
bash sapi/scripts/tencentyun-upload-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip
8 changes: 8 additions & 0 deletions .github/workflows/macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,11 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: swoole-cli-v${{ env.APP_VERSION }}-macos-arm64.tar.xz

- name: uploade artifacts to cloud object storage
if: startsWith(github.ref, 'refs/tags/v')
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
run: |
bash sapi/scripts/tencentyun-upload-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip
8 changes: 8 additions & 0 deletions .github/workflows/macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,11 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: swoole-cli-v${{ env.APP_VERSION }}-macos-x64.tar.xz

- name: uploade artifacts to cloud object storage
if: startsWith(github.ref, 'refs/tags/v')
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
run: |
bash sapi/scripts/tencentyun-upload-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-macos-x64.tar.xz
8 changes: 8 additions & 0 deletions .github/workflows/windows-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: swoole-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip

- name: uploade artifacts to cloud object storage
if: startsWith(github.ref, 'refs/tags/v')
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
run: |
bash sapi/scripts/tencentyun-upload-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip
47 changes: 29 additions & 18 deletions sapi/scripts/tencentyun-upload-cloud-object-storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,21 @@ cp -f ${APP_RUNTIME} coscli

SWOOLE_CLI_VERSION='v5.1.6.0'
SWOOLE_VERSION='v5.1.6'
UPLOAD_FILE=''
UPLOAD_TYPE=''
while [ $# -gt 0 ]; do
case "$1" in
--swoole-cli-version)
SWOOLE_CLI_VERSION="$2"
;;
--*)
echo "Illegal option $1"
--upload-single-file)
UPLOAD_FILE="$2"
UPLOAD_TYPE='single'
;;
--upload-all-artifact-file)
UPLOAD_TYPE='all'
;;

esac
shift $(($# > 0 ? 1 : 0))
done
Expand All @@ -78,29 +85,33 @@ if [ ! -f ${CLOUD_OBJECT_STORAGE_CONFIG} ]; then
if [ -n "${SECRET_ID}" ] && [ -n "${SECRET_KEY}" ]; then
sed -i.bak "s/\${{ secrets.QCLOUD_OSS_SECRET_ID }}/${SECRET_ID}/" ${CLOUD_OBJECT_STORAGE_CONFIG}
sed -i.bak "s/\${{ secrets.QCLOUD_OSS_SECRET_KEY }}/${SECRET_KEY}/" ${CLOUD_OBJECT_STORAGE_CONFIG}

fi
fi
COSCLI="${__PROJECT__}/var/upload-release-oss/coscli "

${COSCLI} --config-path ${CLOUD_OBJECT_STORAGE_CONFIG} ls cos://wenda-1252906962/dist/
exit 0

if [ -d ${__PROJECT__}/var/artifact-hash/${SWOOLE_CLI_VERSION} ]; then
SWOOLE_VERSION=$(echo ${SWOOLE_CLI_VERSION} | awk -F '.' '{ printf "%s.%s.%s" ,$1,$2,$3 }')
else
echo "please download release artifact !"
echo "bash ${__PROJECT__}/sapi/scripts/generate-artifact-hash.sh --version ${SWOOLE_CLI_VERSION}"
if [ "${UPLOAD_TYPE}" = 'single' ]; then
${COSCLI} sync ${UPLOAD_FILE} cos://wenda-1252906962/dist/
exit 0
fi

cd ${__PROJECT__}/var/artifact-hash/${SWOOLE_CLI_VERSION}
${COSCLI}
exit 0
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-cygwin-x64.zip cos://examplebucket-1250000000/
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-linux-arm64.tar.xz cos://examplebucket-1250000000/
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-linux-x64.tar.xz cos://examplebucket-1250000000/
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-macos-arm64.tar.xz cos://examplebucket-1250000000/
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-macos-x64.tar.xz cos://examplebucket-1250000000/
if [ "${UPLOAD_TYPE}" = 'all' ]; then
if [ -d ${__PROJECT__}/var/artifact-hash/${SWOOLE_CLI_VERSION} ]; then
SWOOLE_VERSION=$(echo ${SWOOLE_CLI_VERSION} | awk -F '.' '{ printf "%s.%s.%s" ,$1,$2,$3 }')
else
echo "please download release artifact !"
echo "bash ${__PROJECT__}/sapi/scripts/generate-artifact-hash.sh --version ${SWOOLE_CLI_VERSION}"
exit 0
fi

cd ${__PROJECT__}/var/artifact-hash/${SWOOLE_CLI_VERSION}
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-cygwin-x64.zip cos://wenda-1252906962/dist/
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-linux-arm64.tar.xz cos://wenda-1252906962/dist/
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-linux-x64.tar.xz cos://wenda-1252906962/dist/
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-macos-arm64.tar.xz cos://wenda-1252906962/dist/
${COSCLI} sync swoole-cli-${SWOOLE_VERSION}-macos-x64.tar.xz cos://wenda-1252906962/dist/

cd ${__PROJECT__}
cd ${__PROJECT__}
exit 0
fi

0 comments on commit bc2e161

Please sign in to comment.