From c8266ce7d1cda9e7ee9cb29875711faca4b66952 Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Wed, 28 Feb 2024 13:24:21 +0300 Subject: [PATCH] Add the "Promote" CI job for uptest Signed-off-by: Alper Rifat Ulucinar --- .github/workflows/promote.yaml | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/promote.yaml diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml new file mode 100644 index 00000000..47933452 --- /dev/null +++ b/.github/workflows/promote.yaml @@ -0,0 +1,47 @@ +name: Promote + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g. v0.1.0)' + required: true + channel: + description: 'Release channel' + required: true + default: 'alpha' + +env: + # Common versions + GO_VERSION: '1.19' + + # Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run + # a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether + # credentials have been provided before trying to run steps that need them. + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + +jobs: + promote-artifacts: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Fetch History + run: git fetch --prune --unshallow + + - name: Promote Artifacts in S3 + if: env.AWS_ACCESS_KEY_ID != '' + run: make -j2 promote BRANCH_NAME=${GITHUB_REF##*/} + env: + VERSION: ${{ github.event.inputs.version }} + CHANNEL: ${{ github.event.inputs.channel }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: us-east-1