Skip to content

Commit

Permalink
ci: add 'release-install-script' manually trigger job
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy17 committed Aug 22, 2023
1 parent 0508c97 commit fe5f63d
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
release-install-script:
type: boolean
description: "Release install script to AWS-CN S3 bucket"
required: false
default: true

env:
GO_VERSION: "1.21"
MAX_UPLOAD_RETRY_TIMES: 20
UPLOAD_RETRY_TIMEOUT: 10 # minutes

jobs:
build:
name: build-binary
if: ${{ github.event_name == 'push' }}
strategy:
matrix:
# The file format is gtctl-<os>-<arch>
Expand Down Expand Up @@ -75,8 +85,8 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CN_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: ${{ vars.AWS_CN_RELEASE_BUCKET_REGION }}
with:
max_attempts: 20
timeout_minutes: 5
max_attempts: ${{ env.MAX_UPLOAD_RETRY_TIMES }}
timeout_minutes: ${{ env.UPLOAD_RETRY_TIMEOUT }}
command: |
aws s3 cp \
bin/${{ matrix.file }}.tgz \
Expand Down Expand Up @@ -113,3 +123,23 @@ jobs:
tag: ${{ github.ref_name }}
artifacts: |
**/gtctl-*
release-install-script:
name: release-install-script
if: ${{ inputs.release-install-script }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Upload install.sh to S3
uses: nick-invision/retry@v2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CN_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CN_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: ${{ vars.AWS_CN_RELEASE_BUCKET_REGION }}
with:
max_attempts: ${{ env.MAX_UPLOAD_RETRY_TIMES }}
timeout_minutes: ${{ env.UPLOAD_RETRY_TIMEOUT }}
command: |
aws s3 cp hack/install.sh s3://${{ vars.AWS_CN_RELEASE_BUCKET }}/releases/scripts/gtctl/install.sh

0 comments on commit fe5f63d

Please sign in to comment.