Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker automation tweak #978

Merged
merged 4 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:

permissions:
contents: write # this is the permission that allows creating a new release
packages: write # this is the permission that allows pushing Docker images

defaults:
run:
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ on:
type: boolean
default: false
required: false
only_docker:
description: "Only release Docker image, skip GitHub & PyPI"
type: boolean
default: false
required: false
workflow_call:
inputs:
sha:
Expand Down Expand Up @@ -129,6 +134,7 @@ jobs:
echo Package test command: ${{ inputs.package_test_command }}
echo Test run: ${{ inputs.test_run }}
echo Nightly release: ${{ inputs.nightly_release }}
echo Only Docker: ${{ inputs.only_docker }}

bump-version-generate-changelog:
name: Bump package version, Generate changelog
Expand All @@ -144,7 +150,7 @@ jobs:

log-outputs-bump-version-generate-changelog:
name: "[Log output] Bump package version, Generate changelog"
if: ${{ !failure() && !cancelled() }}
if: ${{ !failure() && !cancelled() && !inputs.only_docker }}
needs: [bump-version-generate-changelog]
runs-on: ubuntu-latest
steps:
Expand All @@ -155,7 +161,7 @@ jobs:

build-test-package:
name: Build, Test, Package
if: ${{ !failure() && !cancelled() }}
if: ${{ !failure() && !cancelled() && !inputs.only_docker }}
needs: [bump-version-generate-changelog]
uses: dbt-labs/dbt-release/.github/workflows/build.yml@main
with:
Expand All @@ -173,7 +179,7 @@ jobs:

github-release:
name: GitHub Release
if: ${{ !failure() && !cancelled() }}
if: ${{ !failure() && !cancelled() && !inputs.only_docker }}
needs: [bump-version-generate-changelog, build-test-package]
uses: dbt-labs/dbt-release/.github/workflows/github-release.yml@main
with:
Expand All @@ -184,7 +190,7 @@ jobs:

pypi-release:
name: PyPI Release
if: ${{ !failure() && !cancelled() }}
if: ${{ !failure() && !cancelled() && !inputs.only_docker }}
needs: [bump-version-generate-changelog, build-test-package]
uses: dbt-labs/dbt-release/.github/workflows/pypi-release.yml@main
with:
Expand All @@ -196,7 +202,10 @@ jobs:

docker-release:
name: "Docker Release"
if: ${{ !failure() && !cancelled() }}
# We cannot release to docker on a test run because it uses the tag in GitHub as
# what we need to release but draft releases don't actually tag the commit so it
# finds nothing to release
if: ${{ !failure() && !cancelled() && (!inputs.test_run || inputs.only_docker) }}
needs: [bump-version-generate-changelog, build-test-package, github-release]
permissions:
packages: write
Expand Down
Loading