Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

发版时自动上传到腾讯云对象存储 #874

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/artifact-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ on:
version:
required: true
description: "发版 版本号 tag"
default: 'v5.1.6.0'
default: 'v6.0.0.0'
type: string
enable_upload_cloud_object_storage:
required: false
type: boolean
description: "上传到云对象存储 (默认不需要上传)"

jobs:
generate-artifact-hash:
Expand All @@ -25,3 +29,14 @@ jobs:
retention-days: 90
path: |
${{ inputs.version }}-sha256sum

- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (inputs.enable_upload_cloud_object_storage == true) }}
env:
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-all --swoole-cli-version ${{ inputs.version }}

5 changes: 2 additions & 3 deletions .github/workflows/auto-cache-pool-tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
key: source-code-tarball-pool

- name: Clean Source Code Tarball Cache On Release
if: startsWith(github.ref, 'refs/tags/')
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run:
rm -rf ${{ github.workspace }}/pool/*

Expand Down Expand Up @@ -100,7 +100,6 @@ jobs:
ls -A pool/ext/

- name: production artifacts
if: 1
uses: actions/upload-artifact@v4
with:
name: all-deps
Expand All @@ -111,7 +110,7 @@ jobs:

- name: gh release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: |
all-deps.zip
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/linux-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,13 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: swoole-cli-v${{ env.APP_VERSION }}-linux-arm64.tar.xz

- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-linux-arm64.tar.xz
10 changes: 10 additions & 0 deletions .github/workflows/linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,13 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: swoole-cli-v${{ env.APP_VERSION }}-linux-x64.tar.xz

- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-linux-x64.tar.xz
10 changes: 10 additions & 0 deletions .github/workflows/macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,13 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: swoole-cli-v${{ env.APP_VERSION }}-macos-arm64.tar.xz

- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-macos-arm64.tar.xz
10 changes: 10 additions & 0 deletions .github/workflows/macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,13 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: swoole-cli-v${{ env.APP_VERSION }}-macos-x64.tar.xz

- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-macos-x64.tar.xz
26 changes: 23 additions & 3 deletions .github/workflows/windows-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ jobs:
run: |
ls -lah /cygdrive/c/
ls -lah /cygdrive/d/

cp -f /cygdrive/c/setup.exe /cygdrive/c/cygwin/bin/setup-x86_64.exe

bash ./sapi/scripts/cygwin/install-cygwin.sh

- name: Install Cygwin Packages
Expand Down Expand Up @@ -135,8 +133,30 @@ jobs:

- name: gh release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: swoole-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip

upload-to-cloud-object-storage:
if: 1
runs-on: ubuntu-latest
needs: windows-cygwin
steps:
- name: Prepare Run Environment
run:
sudo apt install -y curl
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
FILE_NAME=$(ls -d swoole-cli-v*-cygwin-x64)
FILE="${{ github.workspace }}/${FILE_NAME}/${FILE_NAME}.zip"
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${FILE}
Loading
Loading