diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index e69de29bb..000000000 diff --git a/scripts/env-setup.sh b/.github/scripts/env-setup.sh similarity index 100% rename from scripts/env-setup.sh rename to .github/scripts/env-setup.sh diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 1dc396154..c986a4d0f 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -50,11 +50,15 @@ jobs: commit_sha=$(git rev-parse HEAD) echo "release_commit=$commit_sha" >> $GITHUB_OUTPUT - - name: "Get Current Version Number" - id: version-number-sources - run: | - current_version=`awk -F"current_version = " '{print $2}' .bumpversion.cfg | tr '\n' ' '` - echo "current_version=$current_version" >> $GITHUB_OUTPUT + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - uses: pypa/hatch@install + + - id: version-number-sources + run: echo "current_version=$(hatch version)" >> $GITHUB_OUTPUT - name: "Audit Version And Parse Into Parts" id: semver @@ -108,10 +112,5 @@ jobs: sha: ${{ needs.aggregate-release-data.outputs.commit_sha }} target_branch: ${{ needs.aggregate-release-data.outputs.release_branch }} version_number: ${{ needs.aggregate-release-data.outputs.version_number }} - build_script_path: "scripts/build-dist.sh" - env_setup_script_path: "scripts/env-setup.sh" - s3_bucket_name: "core-team-artifacts" - package_test_command: "dbt -h" - test_run: true nightly_release: true secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18fa346e6..15840e5ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ on: env_setup_script_path: description: "Environment setup script path" type: string - default: "scripts/env-setup.sh" + default: "./.github/scripts/env-setup.sh" required: false s3_bucket_name: description: "AWS S3 bucket name" @@ -88,7 +88,7 @@ on: env_setup_script_path: description: "Environment setup script path" type: string - default: "scripts/env-setup.sh" + default: "./.github/scripts/env-setup.sh" required: false s3_bucket_name: description: "AWS S3 bucket name" @@ -121,7 +121,7 @@ defaults: jobs: release-prep: name: "Release prep: generate changelog, bump version" - uses: dbt-labs/dbt-snowflake/.github/workflows/release_prep_hatch.yml@main + uses: ./.github/workflows/release_prep_hatch.yml with: branch: ${{ inputs.branch }} version: ${{ inputs.version }} diff --git a/.github/workflows/release_prep_hatch.yml b/.github/workflows/release_prep_hatch.yml index dde861251..ee092600d 100644 --- a/.github/workflows/release_prep_hatch.yml +++ b/.github/workflows/release_prep_hatch.yml @@ -77,7 +77,7 @@ defaults: shell: bash env: - PYTHON_TARGET_VERSION: 3.12 + PYTHON_DEFAULT_VERSION: 3.9 NOTIFICATION_PREFIX: "[Release Prep]" jobs: @@ -100,7 +100,7 @@ jobs: echo Deploy to: ${{ inputs.deploy-to }} echo Nightly release: ${{ inputs.is-nightly-release }} # ENVIRONMENT VARIABLES - echo Python version: ${{ env.PYTHON_TARGET_VERSION }} + echo Python version: ${{ env.PYTHON_DEFAULT_VERSION }} echo Notification prefix: ${{ env.NOTIFICATION_PREFIX }} - name: "Checkout ${{ github.event.repository.name }}@${{ inputs.branch }}" @@ -108,8 +108,11 @@ jobs: with: ref: ${{ inputs.branch }} - - name: "Setup `hatch`" - uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_DEFAULT_VERSION }} + + - uses: pypa/hatch@install - name: "Parse input version" id: semver @@ -223,8 +226,11 @@ jobs: with: ref: ${{ needs.release-branch.outputs.name }} - - name: "Setup `hatch`" - uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_DEFAULT_VERSION }} + + - uses: pypa/hatch@install - name: "Install `changie`" run: | @@ -296,8 +302,11 @@ jobs: with: ref: ${{ needs.release-branch.outputs.name }} - - name: "Setup `hatch`" - uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_DEFAULT_VERSION }} + + - uses: pypa/hatch@install - name: "Bump version to ${{ inputs.version }}" run: hatch version ${{ inputs.version }} @@ -338,8 +347,11 @@ jobs: with: ref: ${{ needs.release-branch.outputs.name }} - - name: "Setup `hatch`" - uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - uses: pypa/hatch@install - name: "Run unit tests" run: hatch run unit-tests @@ -361,8 +373,11 @@ jobs: with: ref: ${{ needs.release-branch.outputs.name }} - - name: "Set up `hatch`" - uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_DEFAULT_VERSION }} + + - uses: pypa/hatch@install - name: "Run integration tests" run: hatch run integration-tests diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml deleted file mode 100644 index bde34d683..000000000 --- a/.github/workflows/version-bump.yml +++ /dev/null @@ -1,28 +0,0 @@ -# **what?** -# This workflow will take the new version number to bump to. With that -# it will run versionbump to update the version number everywhere in the -# code base and then run changie to create the corresponding changelog. -# A PR will be created with the changes that can be reviewed before committing. - -# **why?** -# This is to aid in releasing dbt and making sure we have updated -# the version in all places and generated the changelog. - -# **when?** -# This is triggered manually - -name: Version Bump - -on: - workflow_dispatch: - inputs: - version_number: - description: 'The version number to bump to (ex. 1.2.0, 1.3.0b1)' - required: true - -jobs: - version_bump_and_changie: - uses: dbt-labs/actions/.github/workflows/version-bump.yml@main - with: - version_number: ${{ inputs.version_number }} - secrets: inherit # ok since what we are calling is internally maintained diff --git a/scripts/build-dist.sh b/scripts/build-dist.sh deleted file mode 100755 index 3c3808399..000000000 --- a/scripts/build-dist.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -DBT_PATH="$( cd "$(dirname "$0")/.." ; pwd -P )" - -PYTHON_BIN=${PYTHON_BIN:-python} - -echo "$PYTHON_BIN" - -set -x - -rm -rf "$DBT_PATH"/dist -rm -rf "$DBT_PATH"/build -mkdir -p "$DBT_PATH"/dist - -cd "$DBT_PATH" -$PYTHON_BIN setup.py sdist bdist_wheel - -set +x