180 lines
6.5 KiB
YAML
180 lines
6.5 KiB
YAML
name: Release Open Source Airbyte
|
|
concurrency: release-airbyte
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
partToBump:
|
|
description: "Please choose the type of version upgrade : major|minor|patch"
|
|
required: true
|
|
default: "patch"
|
|
jobs:
|
|
find_valid_pat:
|
|
name: "Find a PAT with room for actions"
|
|
timeout-minutes: 10
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
pat: ${{ steps.variables.outputs.pat }}
|
|
steps:
|
|
- name: Checkout Airbyte
|
|
uses: actions/checkout@v2
|
|
- name: Check PAT rate limits
|
|
id: variables
|
|
run: |
|
|
./tools/bin/find_non_rate_limited_PAT \
|
|
${{ secrets.AIRBYTEIO_PAT }} \
|
|
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
|
|
${{ secrets.SUPERTOPHER_PAT }} \
|
|
${{ secrets.DAVINCHIA_PAT }}
|
|
# In case of self-hosted EC2 errors, remove this block.
|
|
start-release-airbyte-runner:
|
|
name: "Release Airbyte: Start EC2 Runner"
|
|
needs: find_valid_pat
|
|
timeout-minutes: 10
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
label: ${{ steps.start-ec2-runner.outputs.label }}
|
|
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
|
|
steps:
|
|
- name: Checkout Airbyte
|
|
uses: actions/checkout@v2
|
|
- name: Start AWS Runner
|
|
id: start-ec2-runner
|
|
uses: ./.github/actions/start-aws-runner
|
|
with:
|
|
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
|
|
github-token: ${{ needs.find_valid_pat.outputs.pat }}
|
|
|
|
releaseAirbyte:
|
|
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest.
|
|
needs: start-release-airbyte-runner # required to start the main job when the runner is ready
|
|
runs-on: ${{ needs.start-release-airbyte-runner.outputs.label }} # run the job on the newly created runner
|
|
environment: more-secrets
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-java@v1
|
|
with:
|
|
java-version: "17"
|
|
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: "lts/gallium"
|
|
# necessary to install pip
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.9"
|
|
- name: Release Airbyte
|
|
id: release_airbyte
|
|
env:
|
|
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
PART_TO_BUMP: ${{ github.event.inputs.partToBump }}
|
|
CLOUDREPO_USER: ${{ secrets.CLOUDREPO_USER }}
|
|
CLOUDREPO_PASSWORD: ${{ secrets.CLOUDREPO_PASSWORD }}
|
|
run: |
|
|
./tools/bin/release_version.sh
|
|
|
|
# We are releasing octavia from a separate job because:
|
|
# - The self hosted runner used in releaseAirbyte does not have the docker buildx command to build multi-arch images
|
|
releaseOctavia:
|
|
runs-on: ubuntu-latest
|
|
environment: more-secrets
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-java@v1
|
|
with:
|
|
java-version: "17"
|
|
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: "lts/gallium"
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.9"
|
|
- name: Release Octavia
|
|
id: release_octavia
|
|
env:
|
|
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
PART_TO_BUMP: ${{ github.event.inputs.partToBump }}
|
|
run: ./tools/bin/release_version_octavia.sh
|
|
|
|
createPullRequest:
|
|
needs:
|
|
- releaseAirbyte
|
|
- releaseOctavia
|
|
runs-on: ubuntu-latest
|
|
environment: more-secrets
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
# necessary to install pip
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.9"
|
|
- name: Bump version
|
|
id: bump_version
|
|
env:
|
|
PART_TO_BUMP: ${{ github.event.inputs.partToBump }}
|
|
run: ./tools/bin/bump_version.sh
|
|
- name: Get PR Body
|
|
id: pr_body
|
|
env:
|
|
PREV_VERSION: ${{ steps.bump_version.outputs.PREV_VERSION }}
|
|
NEW_VERSION: ${{ steps.bump_version.outputs.NEW_VERSION }}
|
|
GIT_REVISION: ${{ steps.bump_version.outputs.GIT_REVISION }}
|
|
run: |
|
|
chmod +x tools/bin/pr_body.sh
|
|
body=$(./tools/bin/pr_body.sh)
|
|
body="${body//$'\n'/'%0A'}"
|
|
echo ::set-output name=PR_BODY::$body
|
|
- name: Create Pull Request
|
|
id: cpr
|
|
uses: peter-evans/create-pull-request@v3
|
|
with:
|
|
token: ${{ secrets.SLASH_COMMAND_PAT }}
|
|
branch: bump-version
|
|
branch-suffix: random
|
|
delete-branch: true
|
|
title: Bump Airbyte version from ${{ steps.bump_version.outputs.PREV_VERSION }} to ${{ steps.bump_version.outputs.NEW_VERSION }}
|
|
body: ${{ steps.pr_body.outputs.PR_BODY }}
|
|
commit-message: Bump Airbyte version from ${{ steps.bump_version.outputs.PREV_VERSION }} to ${{ steps.bump_version.outputs.NEW_VERSION }}
|
|
- name: PR Details
|
|
run: |
|
|
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
|
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
|
|
|
# In case of self-hosted EC2 errors, remove this block.
|
|
stop-release-airbyte-runner:
|
|
name: "Release Airbyte: Stop EC2 Runner"
|
|
timeout-minutes: 10
|
|
needs:
|
|
- start-release-airbyte-runner # required to get output from the start-runner job
|
|
- releaseAirbyte # required to wait when the main job is done
|
|
- find_valid_pat
|
|
runs-on: ubuntu-latest
|
|
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
|
|
steps:
|
|
- name: Configure AWS credentials
|
|
uses: aws-actions/configure-aws-credentials@v1
|
|
with:
|
|
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
|
|
aws-region: us-east-2
|
|
- name: Stop EC2 runner
|
|
uses: supertopher/ec2-github-runner@base64v1.0.10
|
|
with:
|
|
mode: stop
|
|
github-token: ${{ needs.find_valid_pat.outputs.pat }}
|
|
label: ${{ needs.start-release-airbyte-runner.outputs.label }}
|
|
ec2-instance-id: ${{ needs.start-release-airbyte-runner.outputs.ec2-instance-id }}
|