-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mp/fix_is_iceberg_warning
- Loading branch information
Showing
66 changed files
with
801 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "Bot commit" | ||
description: "Commit to a local branch using the build bot" | ||
|
||
inputs: | ||
message: | ||
description: "The commit message" | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- run: | | ||
git config user.name "$USERNAME" | ||
git config user.email "$EMAIL" | ||
git pull | ||
git add . | ||
git commit -m "$MESSAGE" | ||
git push | ||
shell: bash | ||
env: | ||
USERNAME: "Github Build Bot" | ||
EMAIL: "[email protected]" | ||
MESSAGE: "[Automated] ${{ inputs.message }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: "Bump version" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package: | ||
description: "Choose the package to bump" | ||
type: string | ||
required: true | ||
branch: | ||
description: "Choose the branch to use" | ||
type: string | ||
default: "main" | ||
version: | ||
description: "Choose the version to bump to (e.g. 1.2.3rc1, patch, release)" | ||
type: string | ||
default: "" | ||
outputs: | ||
initial: | ||
description: "The version before the bump" | ||
value: ${{ jobs.main.outputs.initial }} | ||
final: | ||
description: "The version after the bump" | ||
value: ${{ jobs.main.outputs.final }} | ||
secrets: | ||
FISHTOWN_BOT_PAT: | ||
description: "Token to commit/merge changes into branches" | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
package: | ||
description: "Choose the package to bump" | ||
type: choice | ||
options: | ||
- "dbt-adapters" | ||
- "dbt-tests-adapter" | ||
- "dbt-athena" | ||
- "dbt-bigquery" | ||
- "dbt-postgres" | ||
- "dbt-redshift" | ||
- "dbt-snowflake" | ||
- "dbt-spark" | ||
branch: | ||
description: "Choose the branch to use" | ||
type: string | ||
default: "main" | ||
version: | ||
description: "Choose the version to bump to (e.g. 1.2.3rc1, patch, release)" | ||
type: string | ||
default: "" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
main: | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
outputs: | ||
initial: ${{ steps.version.outputs.initial | ||
final: ${{ steps.version.outputs.final | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }} | ||
- uses: pypa/hatch@install | ||
# bump the version or perform a no-op ("") | ||
- id: version | ||
run: | | ||
echo "initial=$(hatch version)" >> $GITHUB_OUTPUT | ||
hatch version ${{ inputs.version }} | ||
echo "final=$(hatch version)" >> $GITHUB_OUTPUT | ||
working-directory: ./${{ inputs.package }} | ||
- run: sed -i "s/$INITIAL/$FINAL/g" dbt-athena-community/pyproject.toml | ||
if: inputs.package == 'dbt-athena' && steps.version.outputs.final != steps.version.outputs.initial | ||
env: | ||
INITIAL: ${{ steps.version.outputs.initial }} | ||
FINAL: ${{ steps.version.outputs.final }} | ||
- uses: ./.github/actions/bot-commit | ||
if: steps.version.outputs.final != steps.version.outputs.initial | ||
with: | ||
message: "Bump version from ${{ steps.version.outputs.initial }} to ${{ steps.version.outputs.final }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
name: "Changelog generation" | ||
name: "# Changelog generation" | ||
run-name: "Changelog generation - ${{ github.actor }} - package:${{ inputs.package }} merge:${{ inputs.merge }} branch:${{ inputs.branch }}" | ||
|
||
on: | ||
workflow_call: | ||
|
@@ -7,10 +8,6 @@ on: | |
description: "Choose the package getting published" | ||
type: string | ||
default: "dbt-adapters" | ||
merge: | ||
description: "Choose whether to merge the changelog branch" | ||
type: boolean | ||
default: true | ||
branch: | ||
description: "Choose the branch to use" | ||
type: string | ||
|
@@ -33,36 +30,21 @@ on: | |
type: choice | ||
options: | ||
- "dbt-adapters" | ||
- "dbt-tests-adapter" | ||
- "dbt-athena" | ||
- "dbt-athena-community" | ||
- "dbt-bigquery" | ||
- "dbt-postgres" | ||
- "dbt-redshift" | ||
- "dbt-snowflake" | ||
- "dbt-spark" | ||
merge: | ||
description: "Choose whether to merge the changelog branch" | ||
type: boolean | ||
default: false | ||
branch: | ||
description: "Choose the branch to use" | ||
type: string | ||
default: "main" | ||
secrets: | ||
FISHTOWN_BOT_PAT: | ||
description: "Token to commit/merge changes into branches" | ||
required: true | ||
IT_TEAM_MEMBERSHIP: | ||
description: "Token that can view org level teams" | ||
required: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
version: | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
|
@@ -116,26 +98,8 @@ jobs: | |
echo "exists=$exists">> $GITHUB_OUTPUT | ||
working-directory: ./${{ inputs.package }} | ||
|
||
temp-branch: | ||
needs: [version, changelog] | ||
if: needs.changelog.outputs.exists == 'false' | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
outputs: | ||
name: ${{ steps.branch.outputs.name }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- id: branch | ||
run: | | ||
name="prep-release/${{ inputs.package }}/$GITHUB_RUN_ID" | ||
echo "name=$name" >> $GITHUB_OUTPUT | ||
- run: | | ||
git checkout -b ${{ steps.branch.outputs.name }} | ||
git push -u origin ${{ steps.branch.outputs.name }} | ||
dbt-membership: | ||
needs: [version, changelog] | ||
needs: changelog | ||
if: needs.changelog.outputs.exists == 'false' | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
outputs: | ||
|
@@ -155,16 +119,18 @@ jobs: | |
- run: rm ${{ steps.temp-file.outputs.name }} | ||
|
||
generate-changelog: | ||
needs: [version, changelog, temp-branch, dbt-membership] | ||
needs: | ||
- version | ||
- changelog | ||
- dbt-membership | ||
if: needs.changelog.outputs.exists == 'false' | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.temp-branch.outputs.name }} | ||
ref: ${{ inputs.branch }} | ||
- run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH | ||
- run: | | ||
brew install pre-commit | ||
brew tap miniscruff/changie https://github.com/miniscruff/changie | ||
brew install changie | ||
- run: | | ||
|
@@ -181,51 +147,8 @@ jobs: | |
working-directory: ./${{ inputs.package }} | ||
env: | ||
CHANGIE_CORE_TEAM: ${{ needs.dbt-membership.outputs.team }} | ||
- run: | | ||
pre-commit run trailing-whitespace --files __version__.py CHANGELOG.md .changes/* | ||
pre-commit run end-of-file-fixer --files __version__.py CHANGELOG.md .changes/* | ||
- uses: pre-commit/[email protected] | ||
continue-on-error: true | ||
- run: | | ||
git config user.name "Github Build Bot" | ||
git config user.email "[email protected]" | ||
git pull | ||
git add . | ||
git commit -m "generate changelog" | ||
git push | ||
merge-changes: | ||
needs: [temp-branch, generate-changelog] | ||
if: ${{ needs.temp-branch.outputs.name != '' && inputs.merge }} | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/bot-commit | ||
with: | ||
ref: ${{ needs.temp-branch.outputs.name }} | ||
- uses: everlytic/[email protected] | ||
with: | ||
source_ref: ${{ needs.temp-branch.outputs.name }} | ||
target_branch: ${{ inputs.branch }} | ||
github_token: ${{ secrets.FISHTOWN_BOT_PAT }} | ||
commit_message_template: "[Automated] Merged {source_ref} into target {target_branch} during release process" | ||
- run: git push origin -d ${{ needs.temp-branch.outputs.name }} | ||
|
||
branch: | ||
needs: [temp-branch, merge-changes] | ||
if: ${{ !failure() && !cancelled() }} | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
# always run this job, regardless of whether changelog generation was skipped | ||
# Get the sha that will be released. If the changelog already exists on the input sha and the version has already been bumped, | ||
# then it is what we will release. Otherwise, we generated a changelog and did the version bump in this workflow and there is a | ||
# new sha to use from the merge we just did. Grab that here instead. | ||
outputs: | ||
name: ${{ steps.branch.outputs.name }} | ||
steps: | ||
- id: branch | ||
run: | | ||
if [[ ${{ needs.temp-branch.outputs.name == '' || inputs.merge }} ]] | ||
then | ||
branch="${{ inputs.branch }}" | ||
else | ||
branch=${{ needs.temp-branch.outputs.name }} | ||
fi | ||
echo "name=$branch" >> $GITHUB_OUTPUT | ||
message: "Generate changelog for ${{ needs.version.outputs.raw }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.