Skip to content

Commit

Permalink
Add version bump and changelogs to full release (#233)
Browse files Browse the repository at this point in the history
* move git config, fix or notation

* add pre-release into actual release

* update readme
  • Loading branch information
emmyoop authored Dec 19, 2024
1 parent efb9b63 commit fe45c1c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 18 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@ name: Version Bump and Changelog Generation
run-name: "${{ inputs.version_number }} - Version Bump and Changelog Generation"

on:
workflow_call:
inputs:
version_number:
description: "Version to bump to: ex. 1.14.5"
required: true
type: string
workflow_dispatch:
inputs:
version_number:
description: "Version to bump to: ex. 1.14.5"
required: true
type: string
test_run:
description: "Test run - do not commit changes"
required: false
default: true
default: false
type: boolean

permissions:
Expand Down Expand Up @@ -238,16 +246,16 @@ jobs:
needs: [audit-changelog, audit-version-in-code, create-temp-branch]

steps:
- name: "Set Git User"
run: |
git config user.name "Github Build Bot"
git config user.email "[email protected]"
- name: "Checkout ${{ github.repository }} Branch ${{ needs.create-temp-branch.outputs.branch_name }}"
uses: actions/checkout@v4
with:
ref: ${{ needs.create-temp-branch.outputs.branch_name }}

- name: "Set Git User"
run: |
git config user.name "Github Build Bot"
git config user.email "[email protected]"
- name: "Add Homebrew To PATH"
run: |
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
Expand Down Expand Up @@ -328,13 +336,13 @@ jobs:
# this step will fail on whitespace errors but also correct them, so add a `| true` to avoid failure
- name: "Remove Trailing Whitespace Via Pre-commit"
run: |
pre-commit run trailing-whitespace --files .bumpversion.cfg CHANGELOG.md .changes/* | true
pre-commit run trailing-whitespace --files .bumpversion.cfg CHANGELOG.md .changes/* || true
git status
# this step will fail on newline errors but also correct them, so add a `| true` to avoid failure
- name: "Removing Extra Newlines Via Pre-commit"
run: |
pre-commit run end-of-file-fixer --files .bumpversion.cfg CHANGELOG.md .changes/* | true
pre-commit run end-of-file-fixer --files .bumpversion.cfg CHANGELOG.md .changes/* || true
git status
- name: "Commit & Push Changes"
Expand Down Expand Up @@ -374,7 +382,7 @@ jobs:
needs: [run-unit-tests, create-temp-branch, audit-version-in-code, audit-changelog]
if: |
!failure() && !cancelled() &&
inputs.test_run == false &&
inputs.test_run != true &&
(
needs.audit-changelog.outputs.exists == 'false' ||
needs.audit-version-in-code.outputs.up_to_date == 'false'
Expand All @@ -388,17 +396,17 @@ jobs:
echo needs.audit-changelog.outputs.exists: ${{ needs.audit-changelog.outputs.exists }}
echo needs.audit-version-in-code.outputs.up_to_date: ${{ needs.audit-version-in-code.outputs.up_to_date }}
- name: "Set Git User"
run: |
git config user.name "Github Build Bot"
git config user.email "[email protected]"
- name: "Checkout Repo ${{ github.repository }}"
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{ secrets.FISHTOWN_BOT_PAT }}

- name: "Set Git User"
run: |
git config user.name "Github Build Bot"
git config user.email "[email protected]"
- name: "Merge in changes"
run: |
git fetch origin ${{ needs.create-temp-branch.outputs.branch_name }}
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ name: Release
on:
workflow_dispatch:
inputs:
version_number:
description: "Version to bump to: ex. 1.14.5"
required: true
type: string
deploy-to:
type: choice
description: Choose where to publish (test/prod)
options:
- PypiProd
- PypiTest
default: PypiTest
default: PypiProd

permissions: read-all

Expand All @@ -23,10 +27,20 @@ concurrency:
cancel-in-progress: true

jobs:
release-prep:
permissions:
contents: write
name: "Version bump and Changelog update"
uses: ./.github/actions/release-prep
with:
version_number: ${{ inputs.version_number }}
secrets:
inherit

release:
name: PyPI - ${{ inputs.deploy-to }}
runs-on: ubuntu-latest
needs: release-prep
environment:
name: ${{ inputs.deploy-to }}
permissions:
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ The shared common utilities for dbt-core and adapter implementations use

### Releasing dbt-common
To release a new version of dbt-common to pypi, you'll need to:
1. Bump the `version` in [dbt_common_/__about__.py](https://github.com/dbt-labs/dbt-common/blob/main/dbt_common/__about__.py)
2. Run the [release workflow](https://github.com/dbt-labs/dbt-common/actions/workflows/release.yml) to test pypi and confirm a successful test release in: https://test.pypi.org/project/dbt-common/
3. Run the [release workflow](https://github.com/dbt-labs/dbt-common/actions/workflows/release.yml) to prod pypi and confirm a successful release in: https://pypi.org/project/dbt-common/
1. Run the [release workflow](https://github.com/dbt-labs/dbt-common/actions/workflows/release.yml) to bump the version, generate changelogs and release to pypi
4. Bump the version of `dbt-common` in `dbt-core` and `dbt-adapters` if you're releasing a new major version or a pre-release:
* `dbt-core`: [setup.py](https://github.com/dbt-labs/dbt-core/blob/main/core/setup.py)
* `dbt-adapters`: [pyproject.toml](https://github.com/dbt-labs/dbt-adapters/blob/main/pyproject.toml)
Expand Down

0 comments on commit fe45c1c

Please sign in to comment.