Skip to content

Commit

Permalink
Merge pull request #367 from Release 2022-11
Browse files Browse the repository at this point in the history
Release version 2022-11
  • Loading branch information
aarroyosal authored Nov 22, 2022
2 parents 0e6c1de + 8c1c546 commit 18b32d7
Show file tree
Hide file tree
Showing 21 changed files with 485 additions and 140 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/bigquery-ded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,29 @@ jobs:
timeout-minutes: 20
env:
GCLOUD_VERSION: 290.0.1
BQ_PREFIX: dedicated_${{ github.event.pull_request.number }}_
BQ_PROJECT: ${{ secrets.BQ_PROJECT_CD }}
BQ_REGION: ${{ secrets.BQ_REGION_CD }}
BQ_BUCKET: ${{ secrets.BQ_BUCKET_CD }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set BQ_PREFIX for releases
if: startsWith(github.event.pull_request.head.ref, 'release/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/}
echo "BQ_PREFIX=dedicated_release_${VERSION}_" >> $GITHUB_ENV
- name: Set BQ_PREFIX for hotfixes
if: startsWith(github.event.pull_request.head.ref, 'hotfix/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix/}
echo "BQ_PREFIX=dedicated_release_${VERSION}_" >> $GITHUB_ENV
- name: Set BQ_PREFIX for regular deploys
if: |
!(startsWith(github.event.pull_request.head.ref, 'hotfix/')) &&
!(startsWith(github.event.pull_request.head.ref, 'release/'))
run: echo "BQ_PREFIX=dedicated_${{ github.event.pull_request.number }}_" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/bigquery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Bigquery CI/CD
on:
push:
branches:
- master
- main
paths:
- "clouds/bigquery/**"
- ".github/workflows/bigquery.yml"
Expand All @@ -12,6 +12,7 @@ on:
- "clouds/bigquery/**"
- ".github/workflows/bigquery.yml"
workflow_dispatch:
workflow_call:

env:
NODE_VERSION: 14
Expand Down Expand Up @@ -63,7 +64,7 @@ jobs:
make remove
deploy-internal:
if: github.ref_name == 'master'
if: github.ref_name == 'main'
needs: test
runs-on: ubuntu-20.04
timeout-minutes: 20
Expand All @@ -90,10 +91,10 @@ jobs:
- name: Run deploy
run: |
cd clouds/bigquery
make deploy diff="$GIT_DIFF" production=1
make deploy diff="$GIT_DIFF"
deploy:
if: github.ref_name == 'master'
if: github.ref_name == 'stable'
needs: test
runs-on: ubuntu-20.04
timeout-minutes: 20
Expand Down Expand Up @@ -137,7 +138,7 @@ jobs:
make deploy diff="$GIT_DIFF" production=1
publish:
if: github.ref_name == 'master'
if: github.ref_name == 'stable'
needs: test
runs-on: ubuntu-20.04
timeout-minutes: 10
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/databricks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Databricks CI/CD
on:
push:
branches:
- master
- main
paths:
- "clouds/databricks/**"
- ".github/workflows/databricks.yml"
Expand All @@ -12,6 +12,7 @@ on:
- "clouds/databricks/**"
- ".github/workflows/databricks.yml"
workflow_dispatch:
workflow_call:

env:
PYTHON3_VERSION: 3.8.11
Expand Down Expand Up @@ -66,7 +67,7 @@ jobs:
make remove
deploy-internal:
if: github.ref_name == 'master'
if: github.ref_name == 'main'
needs: test
runs-on: ubuntu-20.04
timeout-minutes: 20
Expand Down Expand Up @@ -106,11 +107,11 @@ jobs:
DB_TOKEN: ${{ steps.secrets.outputs.databricks-ci-token }}
run: |
cd clouds/databricks
make deploy production=1
make deploy
publish:
needs: test
if: github.ref_name == 'master'
if: github.ref_name == 'stable'
runs-on: ubuntu-20.04
timeout-minutes: 10
env:
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: "Draft new release"

on:
workflow_dispatch:
inputs:
version:
description: 'The version you want to release in format yyyyy-MM, for example 2022-10'
required: true

jobs:
draft-new-release:
name: "Draft a new release"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.CARTOFANTE_GITHUB_TOKEN }}
- name: Check if release tag exists
run: |
if [[ $(git ls-remote --tags origin refs/tags/${{ github.event.inputs.version }}) ]]; then
echo "## Release ${{ github.event.inputs.version }} already exists"
exit 1
fi
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
bigquery:
- 'clouds/bigquery/version'
databricks:
- 'clouds/databricks/version'
postgres:
- 'clouds/postgres/version'
redshift:
- 'clouds/redshift/version'
snowflake:
- 'clouds/snowflake/version'
base: stable
- name: Update bq changelog
if: steps.changes.outputs.bigquery == 'true'
run: |
BQ_VERSION=$(cat clouds/bigquery/version)
sed -i "s/\[Unreleased\]/\[${BQ_VERSION}\] - ${{ github.event.inputs.version }}/g" clouds/bigquery/CHANGELOG.md
- name: Update databricks changelog
if: steps.changes.outputs.databricks == 'true'
run: |
DB_VERSION=$(cat clouds/snowflake/version)
sed -i "s/\[Unreleased\]/\[${DB_VERSION}\] - ${{ github.event.inputs.version }}/g" clouds/databricks/CHANGELOG.md
- name: Update postgres changelog
if: steps.changes.outputs.postgres == 'true'
run: |
PG_VERSION=$(cat clouds/snowflake/version)
sed -i "s/\[Unreleased\]/\[${PG_VERSION}\] - ${{ github.event.inputs.version }}/g" clouds/postgres/CHANGELOG.md
- name: Update redshift changelog
if: steps.changes.outputs.redshift == 'true'
run: |
RS_VERSION=$(cat clouds/snowflake/version)
sed -i "s/\[Unreleased\]/\[${RS_VERSION}\] - ${{ github.event.inputs.version }}/g" clouds/redshift/CHANGELOG.md
- name: Update snowflake changelog
if: steps.changes.outputs.snowflake == 'true'
run: |
SF_VERSION=$(cat clouds/snowflake/version)
sed -i "s/\[Unreleased\]/\[${SF_VERSION}\] - ${{ github.event.inputs.version }}/g" clouds/snowflake/CHANGELOG.md
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: edit changelog versions
branch: release/${{ github.event.inputs.version }}
create_branch: true
commit_user_name: ${{ secrets.CARTOFANTE_USERNAME }}
commit_user_email: ${{ secrets.CARTOFANTE_EMAIL }}
- name: Create pull request
uses: repo-sync/pull-request@v2
with:
source_branch: release/${{ github.event.inputs.version }}
destination_branch: stable
pr_title: Release version ${{ github.event.inputs.version }}
pr_reviewer: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
pr_body: |
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
Please, check that the version files and changelogs are correct.
This workflow will deploy the DW whose versions have been updated in dedicated environments
Merging this PR will create a GitHub release and publish the AT libraries those DW.
18 changes: 17 additions & 1 deletion .github/workflows/postgres-ded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,30 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 20
env:
PG_PREFIX: dedicated_${{ github.event.number }}_
PG_HOST: ${{ secrets.PG_HOST_CD }}
PG_DATABASE: ${{ secrets.PG_DATABASE_CD }}
PG_USER: ${{ secrets.PG_USER_CD }}
PG_PASSWORD: ${{ secrets.PG_PASSWORD_CD }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set PG_PREFIX for releases
if: startsWith(github.event.pull_request.head.ref, 'release/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/}
echo "PG_PREFIX=dedicated_release_${VERSION}_" >> $GITHUB_ENV
- name: Set PG_PREFIX for hotfixes
if: startsWith(github.event.pull_request.head.ref, 'hotfix/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix/}
echo "PG_PREFIX=dedicated_release_${VERSION}_" >> $GITHUB_ENV
- name: Set PG_PREFIX for regular deploys
if: |
!(startsWith(github.event.pull_request.head.ref, 'hotfix/')) &&
!(startsWith(github.event.pull_request.head.ref, 'release/'))
run: echo "PG_PREFIX=dedicated_${{ github.event.pull_request.number }}_" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Postgres CI/CD
on:
push:
branches:
- master
- main
paths:
- "clouds/postgres/**"
- ".github/workflows/postgres.yml"
Expand All @@ -12,6 +12,7 @@ on:
- "clouds/postgres/**"
- ".github/workflows/postgres.yml"
workflow_dispatch:
workflow_call:

env:
NODE_VERSION: 14
Expand Down Expand Up @@ -53,7 +54,7 @@ jobs:
make remove
deploy-internal:
if: github.ref_name == 'master'
if: github.ref_name == 'main'
needs: test
runs-on: ubuntu-20.04
timeout-minutes: 20
Expand All @@ -80,10 +81,10 @@ jobs:
- name: Run deploy
run: |
cd clouds/postgres
make deploy diff="$GIT_DIFF" production=1
make deploy diff="$GIT_DIFF"
publish:
if: github.ref_name == 'master'
if: github.ref_name == 'stable'
needs: test
runs-on: ubuntu-20.04
timeout-minutes: 10
Expand Down
Loading

0 comments on commit 18b32d7

Please sign in to comment.