-
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 02-05-add_base_implementation_of_catalog_sup…
…port
- Loading branch information
Showing
35 changed files
with
271 additions
and
243 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
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 |
---|---|---|
|
@@ -8,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 | ||
|
@@ -41,29 +37,14 @@ on: | |
- "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 }} | ||
|
@@ -117,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: | ||
|
@@ -156,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: | | ||
|
@@ -182,49 +147,8 @@ jobs: | |
working-directory: ./${{ inputs.package }} | ||
env: | ||
CHANGIE_CORE_TEAM: ${{ needs.dbt-membership.outputs.team }} | ||
- run: pre-commit run --all-files | ||
- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: "Publish OSS" | ||
run-name: "Publish OSS - ${{ github.actor }} - package:${{ inputs.package }} deploy-to:${{ inputs.deploy-to }} branch:${{ inputs.branch }} skip-unit-tests:${{ inputs.skip-unit-tests }} skip-integration-tests:${{ inputs.skip-integration-tests }}" | ||
run-name: "Publish OSS - ${{ github.actor }} - package:${{ inputs.package }} deploy-to:${{ inputs.deploy-to }} branch:${{ inputs.branch }} version:${{ inputs.version }} skip-unit-tests:${{ inputs.skip-unit-tests }} skip-integration-tests:${{ inputs.skip-integration-tests }}" | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -42,56 +42,78 @@ concurrency: | |
group: Publish_OSS-${{ inputs.package }}-${{ inputs.deploy-to }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
work-branch: | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
outputs: | ||
name: ${{ steps.branch.outputs.name }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- id: branch | ||
run: | | ||
name="publish-oss/${{ 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 }} | ||
bump-version: | ||
if: inputs.version != '' | ||
needs: work-branch | ||
uses: ./.github/workflows/_bump-version.yml | ||
with: | ||
package: ${{ inputs.package }} | ||
branch: ${{ inputs.branch }} | ||
branch: ${{ needs.work-branch.outputs.name }} | ||
version: ${{ inputs.version }} | ||
secrets: inherit | ||
|
||
generate-changelog: | ||
if: always() && !failure() | ||
needs: | ||
- work-branch | ||
- bump-version # bump-version may be a no-op, but the changelog should be generated for the latest version | ||
uses: ./.github/workflows/_generate-changelog.yml | ||
with: | ||
package: ${{ inputs.package }} | ||
branch: ${{ needs.work-branch.outputs.name }} | ||
secrets: inherit | ||
|
||
unit-tests: | ||
if: | | ||
always() && !failure() && | ||
inputs.skip-unit-tests == false && | ||
!contains(fromJSON('["dbt-tests-adapter"]'), inputs.package) | ||
needs: bump-version # bump-version can be skipped and is not directly used | ||
needs: | ||
- work-branch | ||
- bump-version # bump-version may be a no-op, but tests need to run with the latest version | ||
uses: ./.github/workflows/_unit-tests.yml | ||
with: | ||
package: ${{ inputs.package }} | ||
branch: ${{ inputs.branch }} | ||
branch: ${{ needs.work-branch.outputs.name }} | ||
|
||
integration-tests: | ||
if: | | ||
always() && !failure() && | ||
inputs.skip-integration-tests == false && | ||
!contains(fromJSON('["dbt-adapters", "dbt-tests-adapter"]'), inputs.package) | ||
needs: bump-version # bump-version can be skipped and is not directly used | ||
needs: | ||
- work-branch | ||
- bump-version # bump-version may be a no-op, but tests need to run with the latest version | ||
uses: ./.github/workflows/_integration-tests.yml | ||
with: | ||
packages: ${{ toJSON(inputs.package) }} | ||
branch: ${{ inputs.branch }} | ||
secrets: inherit | ||
|
||
generate-changelog: | ||
if: always() && !failure() | ||
needs: [bump-version, unit-tests, integration-tests] | ||
uses: ./.github/workflows/_generate-changelog.yml | ||
with: | ||
package: ${{ inputs.package }} | ||
merge: ${{ inputs.deploy-to == 'prod' }} | ||
branch: ${{ inputs.branch }} | ||
branch: ${{ needs.work-branch.outputs.name }} | ||
secrets: inherit | ||
|
||
publish: | ||
if: always() && !failure() | ||
needs: generate-changelog | ||
needs: | ||
- work-branch | ||
- bump-version | ||
- generate-changelog | ||
- unit-tests | ||
- integration-tests | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
environment: | ||
name: ${{ inputs.deploy-to }} | ||
|
@@ -101,9 +123,27 @@ jobs: | |
# see https://github.com/marketplace/actions/pypi-publish | ||
id-token: write | ||
steps: | ||
|
||
# merge changes before publishing to prod because we lock trusted publishing to main | ||
- uses: everlytic/[email protected] | ||
if: inputs.deploy-to == 'prod' | ||
with: | ||
source_ref: ${{ needs.work-branch.outputs.name }} | ||
target_branch: ${{ inputs.branch }} | ||
github_token: ${{ secrets.FISHTOWN_BOT_PAT }} | ||
commit_message_template: "[Automated] Publish ${{ inputs.package }}==${{ needs.bump-version.outputs.final }}" | ||
- uses: actions/checkout@v4 | ||
if: inputs.deploy-to == 'prod' | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
# if we're not publishing to prod, just check out the work branch | ||
- uses: actions/checkout@v4 | ||
if: inputs.deploy-to != 'prod' | ||
with: | ||
ref: ${{ needs.generate-changelog.outputs.branch-name || inputs.branch }} | ||
ref: ${{ needs.work-branch.outputs.name }} | ||
|
||
# build and publish using whichever branch was checked out above | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }} | ||
|
@@ -123,6 +163,7 @@ jobs: | |
retry_wait_seconds: 10 | ||
max_attempts: 15 # 5 minutes: (10s timeout + 10s delay) * 15 attempts | ||
command: wget ${{ vars.PYPI_PROJECT_URL }}/${{ inputs.package }}/${{ steps.version.outputs.version }} | ||
|
||
# publish dbt-athena-community following dbt-athena | ||
- if: inputs.package == 'dbt-athena' | ||
run: hatch build && hatch run build:check-all | ||
|
@@ -139,3 +180,17 @@ jobs: | |
retry_wait_seconds: 10 | ||
max_attempts: 15 # 5 minutes: (10s timeout + 10s delay) * 15 attempts | ||
command: wget ${{ vars.PYPI_PROJECT_URL }}/dbt-athena-community/${{ steps.version.outputs.version }} | ||
|
||
clean-up: | ||
if: always() | ||
needs: | ||
- work-branch | ||
- publish | ||
runs-on: ${{ vars.DEFAULT_RUNNER }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
# we should delete this regardless of whether we merged it to avoid building up stale release branches | ||
- run: git push origin -d ${{ needs.work-branch.outputs.name }} | ||
continue-on-error: true |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## dbt-athena 1.9.2 - March 07, 2025 | ||
|
||
### Features | ||
|
||
- Implement drop_glue_database macro and method ([#408](https://github.com/dbt-labs/dbt-adapters/issues/408)) | ||
|
||
### Under the Hood | ||
|
||
- Issue a warning to dbt-athena-community users to migrate to dbt-athena ([#879](https://github.com/dbt-labs/dbt-adapters/issues/879)) | ||
|
||
### Contributors | ||
- [@svdimchenko](https://github.com/svdimchenko) ([#408](https://github.com/dbt-labs/dbt-adapters/issues/408)) |
Oops, something went wrong.