Release dbt-adapters==1.0.0b2 to test #35
Workflow file for this run
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
name: Release | ||
run-name: Release ${{ inputs.package }}==${{ inputs.version_number }} to ${{ inputs.deploy-to }} | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
package: | ||
type: choice | ||
description: Choose what to publish | ||
options: | ||
- dbt-adapters | ||
- dbt-tests-adapter | ||
version_number: | ||
description: "The release version number (i.e. 1.0.0b1)" | ||
type: string | ||
required: true | ||
deploy-to: | ||
type: choice | ||
description: Choose where to publish | ||
options: | ||
- prod | ||
- test | ||
default: prod | ||
nightly_release: | ||
description: "Nightly release to dev environment" | ||
type: boolean | ||
default: false | ||
required: false | ||
workflow_call: | ||
inputs: | ||
package: | ||
type: string | ||
description: Choose what to publish | ||
required: true | ||
version_number: | ||
description: "The release version number (i.e. 1.0.0b1)" | ||
type: string | ||
required: true | ||
deploy-to: | ||
type: string | ||
default: prod | ||
required: false | ||
nightly_release: | ||
description: "Nightly release to dev environment" | ||
type: boolean | ||
default: false | ||
required: false | ||
# this is the permission that allows creating a new release | ||
permissions: | ||
contents: write | ||
# will cancel previous workflows triggered by the same event and for the same ref for PRs or same SHA otherwise | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }}-${{ inputs.package }}-${{ inputs.deploy-to }} | ||
cancel-in-progress: true | ||
defaults: | ||
run: | ||
shell: bash | ||
jobs: | ||
setup-job-vars: | ||
name: setup job variables | ||
runs-on: ubuntu-latest | ||
outputs: | ||
TEST_RUN: ${{ steps.is_test_run.outputs.TEST_RUN }} | ||
steps: | ||
- id: is_test_run | ||
run: | | ||
echo "TEST_RUN=${{ inputs.deploy-to == 'test' && 'true' || 'false' }}" >> $GITHUB_OUTPUT | ||
bump-version-generate-changelog: | ||
name: Bump package version, Generate changelog | ||
uses: dbt-labs/dbt-adapters/.github/workflows/release_prep_hatch.yml@bumpVersion | ||
with: | ||
version_number: ${{ inputs.version_number }} | ||
test_run: ${{ steps.setup-job-vars.outputs.TEST_RUN }} | ||
Check failure on line 80 in .github/workflows/release.yml GitHub Actions / ReleaseInvalid workflow file
|
||
nightly_release: ${{ inputs.nightly_release }} | ||
secrets: inherit | ||
log-outputs-bump-version-generate-changelog: | ||
name: "[Log output] Bump package version, Generate changelog" | ||
if: ${{ !failure() && !cancelled() }} | ||
needs: [bump-version-generate-changelog] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Print variables | ||
run: | | ||
echo Final SHA : ${{ needs.bump-version-generate-changelog.outputs.final_sha }} | ||
echo Changelog path: ${{ needs.bump-version-generate-changelog.outputs.changelog_path }} | ||
build-and-publish: | ||
name: Build, Test and publish to PyPi | ||
needs: [log-outputs-bump-version-generate-changelog] | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- name: "Check out repository" | ||
uses: actions/checkout@v4 | ||
- name: Setup `hatch` | ||
uses: ./.github/actions/setup-hatch | ||
- name: Build `dbt-adapters` | ||
if: ${{ inputs.package == 'dbt-adapters' }} | ||
uses: ./.github/actions/build-hatch | ||
- name: Build `dbt-tests-adapter` | ||
if: ${{ inputs.package == 'dbt-tests-adapter' }} | ||
uses: ./.github/actions/build-hatch | ||
with: | ||
working-dir: "./dbt-tests-adapter/" | ||
- name: Setup `hatch` | ||
uses: ./.github/actions/setup-hatch | ||
- name: Build `dbt-adapters` | ||
if: ${{ inputs.package == 'dbt-adapters' }} | ||
uses: ./.github/actions/build-hatch | ||
- name: Build `dbt-tests-adapter` | ||
if: ${{ inputs.package == 'dbt-tests-adapter' }} | ||
uses: ./.github/actions/build-hatch | ||
with: | ||
working-dir: "./dbt-tests-adapter/" | ||
# this step is only needed for the release process | ||
- name: "Upload Build Artifact" | ||
if: ${{ github.event_name == 'workflow_call' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.version.outputs.version_number }} | ||
path: | | ||
${{ inputs.changelog_path }} | ||
./dist/ | ||
retention-days: 3 | ||
github-release: | ||
name: GitHub Release | ||
if: ${{ !failure() && !cancelled() }} | ||
needs: [build-and-publish] | ||
uses: dbt-labs/dbt-release/.github/workflows/github-release.yml@main | ||
with: | ||
version_number: ${{ inputs.version_number }} | ||
changelog_path: ${{ needs.bump-version-generate-changelog.outputs.changelog_path }} | ||
test_run: ${{ steps.setup-job-vars.outputs.TEST_RUN }} | ||
pypi-release: | ||
name: Publish to PyPI | ||
runs-on: ubuntu-latest | ||
needs: [github-release] | ||
environment: | ||
name: ${{ inputs.deploy-to }} | ||
url: ${{ vars.PYPI_PROJECT_URL }} | ||
steps: | ||
- name: "Publish to PyPI" | ||
uses: ./.github/actions/publish-pypi | ||
with: | ||
repository-url: ${{ vars.PYPI_REPOSITORY_URL }} | ||
artifacts-dir: ${{ inputs.version_number }} | ||