1
0
mirror of synced 2025-12-26 14:02:10 -05:00
Files
airbyte/.github/workflows/release-airbyte-os.yml
2024-12-18 13:17:19 -08:00

231 lines
8.3 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:
# In case of self-hosted EC2 errors, remove this block.
start-release-airbyte-runner:
name: "Release Airbyte: Start EC2 Runner"
timeout-minutes: 10
runs-on: ubuntu-24.04
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@v3
- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.GH_PAT_BUILD_RUNNER_OSS }} \
${{ secrets.GH_PAT_BUILD_RUNNER_BACKUP }}
- 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: ${{ env.PAT }}
release-airbyte-platform:
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-24.04.
needs:
- start-release-airbyte-runner
runs-on: ${{ needs.start-release-airbyte-runner.outputs.label }} # run the job on the newly created runner
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "21"
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Checkout Airbyte Platform
uses: actions/checkout@v3
with:
repository: airbytehq/airbyte-platform
ref: main
path: airbyte-platform
fetch-depth: 0
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
- name: Release Airbyte Platform
id: release_airbyte_platform
working-directory: airbyte-platform
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 # this script calls the bump_version.sh script
- name: Auto Commit Version for Airbyte Platform
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: airbyte-platform
commit_message: Bump Airbyte version from ${{ steps.release_airbyte_platform.outputs.PREV_VERSION }} to ${{ steps.release_airbyte_platform.outputs.NEW_VERSION }}
- name: Generate Change Log for Airbyte Platform
working-directory: airbyte-platform
env:
PREV_VERSION: ${{ steps.release_airbyte_platform.outputs.PREV_VERSION }}
GIT_REVISION: ${{ steps.release_airbyte_platform.outputs.GIT_REVISION }}
run: |
CHANGELOG=`PAGER=cat git log v${PREV_VERSION}..${GIT_REVISION} --oneline --decorate=no`
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo -e "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo $CHANGELOG
- name: Create Release for Airbyte Platform
id: create_release
uses: ncipollo/release-action@v1
env:
NEW_VERSION: ${{ steps.release_airbyte_platform.outputs.NEW_VERSION }}
with:
owner: airbytehq
repo: airbyte-platform
body: ${{ env.CHANGELOG }}
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
tag: v${{ env.NEW_VERSION }}
release-airbyte:
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-24.04.
needs:
- start-release-airbyte-runner
- release-airbyte-platform
runs-on: ${{ needs.start-release-airbyte-runner.outputs.label }} # run the job on the newly created runner
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Checkout Airbyte
uses: actions/checkout@v3
with:
repository: airbytehq/airbyte
ref: master
path: airbyte
fetch-depth: 0
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
- name: Bump Version for Airbyte
id: bump_version
working-directory: airbyte
env:
PART_TO_BUMP: ${{ github.event.inputs.partToBump }}
run: |
./tools/bin/bump_version.sh
- name: Run run-ab-platform script to download artifacts from Airbyte Platform
working-directory: airbyte
run: |
./run-ab-platform.sh --refresh
./run-ab-platform.sh --download
- name: Auto Commit Version and Platform Artifacts into Airbyte
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: airbyte
commit_message: Bump Airbyte version from ${{ steps.bump_version.outputs.PREV_VERSION }} to ${{ steps.bump_version.outputs.NEW_VERSION }}
push_options: --force
- name: Generate Change Log for Airbyte
working-directory: airbyte
env:
PREV_VERSION: ${{ steps.bump_version.outputs.PREV_VERSION }}
GIT_REVISION: ${{ steps.bump_version.outputs.GIT_REVISION }}
run: |
CHANGELOG=`PAGER=cat git log v${PREV_VERSION}..${GIT_REVISION} --oneline --decorate=no`
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo -e "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo $CHANGELOG
- name: Create Release for Airbyte
id: create_release
uses: ncipollo/release-action@v1
env:
NEW_VERSION: ${{ steps.bump_version.outputs.NEW_VERSION }}
with:
owner: airbytehq
repo: airbyte
body: ${{ env.CHANGELOG }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ env.NEW_VERSION }}
# 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
release-octavia:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "21"
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- 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
# 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
- release-airbyte # required to wait when the main job is done
runs-on: ubuntu-24.04
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: Checkout Airbyte
uses: actions/checkout@v3
- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.GH_PAT_BUILD_RUNNER_OSS }} \
${{ secrets.GH_PAT_BUILD_RUNNER_BACKUP }}
- name: Stop EC2 runner
uses: supertopher/ec2-github-runner@base64v1.0.10
with:
mode: stop
github-token: ${{ env.PAT }}
label: ${{ needs.start-release-airbyte-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-release-airbyte-runner.outputs.ec2-instance-id }}