mirror of
https://github.com/dbt-labs/dbt-core
synced 2025-12-20 17:01:28 +00:00
Compare commits
2 Commits
enable-pos
...
leahwicz/D
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13ba66c49a | ||
|
|
987379c632 |
72
.github/workflows/release-docker.yml
vendored
72
.github/workflows/release-docker.yml
vendored
@@ -5,7 +5,7 @@
|
|||||||
# Docker images for dbt are used in a number of important places throughout the dbt ecosystem. This is how we keep those images up-to-date.
|
# Docker images for dbt are used in a number of important places throughout the dbt ecosystem. This is how we keep those images up-to-date.
|
||||||
|
|
||||||
# **when?**
|
# **when?**
|
||||||
# This is triggered manually
|
# This is triggered manually or by the release workflow
|
||||||
|
|
||||||
# **next steps**
|
# **next steps**
|
||||||
# - build this into the release workflow (or conversly, break out the different release methods into their own workflow files)
|
# - build this into the release workflow (or conversly, break out the different release methods into their own workflow files)
|
||||||
@@ -16,41 +16,48 @@ permissions:
|
|||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
package:
|
||||||
|
description: The package to release. _One_ of [dbt-core, dbt-redshift, dbt-bigquery, dbt-snowflake, dbt-spark, dbt-postgres]
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
package:
|
package:
|
||||||
description: The package to release. _One_ of [dbt-core, dbt-redshift, dbt-bigquery, dbt-snowflake, dbt-spark, dbt-postgres]
|
description: The package to release. _One_ of [dbt-core, dbt-redshift, dbt-bigquery, dbt-snowflake, dbt-spark, dbt-postgres]
|
||||||
required: true
|
required: true
|
||||||
|
type: string
|
||||||
version_number:
|
version_number:
|
||||||
description: The release version number (i.e. 1.0.0b1). Do not include `latest` tags or a leading `v`!
|
description: The release version number (i.e. 1.0.0b1). Do not include `latest` tags or a leading `v`!
|
||||||
required: true
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get_version_meta:
|
get_version_meta:
|
||||||
name: Get version meta
|
name: Get version metadata
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
major: ${{ steps.version.outputs.major }}
|
|
||||||
minor: ${{ steps.version.outputs.minor }}
|
|
||||||
patch: ${{ steps.version.outputs.patch }}
|
|
||||||
latest: ${{ steps.latest.outputs.latest }}
|
latest: ${{ steps.latest.outputs.latest }}
|
||||||
minor_latest: ${{ steps.latest.outputs.minor_latest }}
|
minor_latest: ${{ steps.latest.outputs.minor_latest }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- name: "[DEBUG] Print Variables"
|
||||||
- name: Split version
|
|
||||||
id: version
|
|
||||||
run: |
|
run: |
|
||||||
IFS="." read -r MAJOR MINOR PATCH <<< ${{ github.event.inputs.version_number }}
|
echo "All variables defined as inputs"
|
||||||
echo "major=$MAJOR" >> $GITHUB_OUTPUT
|
echo "The package: ${{ inputs.package }}"
|
||||||
echo "minor=$MINOR" >> $GITHUB_OUTPUT
|
echo "The version_number: ${{ inputs.version_number }}"
|
||||||
echo "patch=$PATCH" >> $GITHUB_OUTPUT
|
|
||||||
|
- name: "Check out the repository"
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Is pkg 'latest'
|
- name: Is pkg 'latest'
|
||||||
id: latest
|
id: latest
|
||||||
uses: ./.github/actions/latest-wrangler
|
uses: ./.github/actions/latest-wrangler
|
||||||
with:
|
with:
|
||||||
package: ${{ github.event.inputs.package }}
|
package: ${{ inputs.package }}
|
||||||
new_version: ${{ github.event.inputs.version_number }}
|
new_version: ${{ inputs.version_number }}
|
||||||
gh_token: ${{ secrets.GITHUB_TOKEN }}
|
gh_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
halt_on_missing: False
|
halt_on_missing: False
|
||||||
|
|
||||||
@@ -60,18 +67,25 @@ jobs:
|
|||||||
needs: [get_version_meta]
|
needs: [get_version_meta]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
build_and_push:
|
build_and_push:
|
||||||
name: Build images and push to GHCR
|
name: Build images and push to GHCR
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [setup_image_builder, get_version_meta]
|
needs: [setup_image_builder, get_version_meta]
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: "Parse Version Into Parts"
|
||||||
|
id: semver
|
||||||
|
uses: dbt-labs/actions/parse-semver@v1
|
||||||
|
with:
|
||||||
|
version: ${{ inputs.version_number }}
|
||||||
|
|
||||||
- name: Get docker build arg
|
- name: Get docker build arg
|
||||||
id: build_arg
|
id: build_arg
|
||||||
run: |
|
run: |
|
||||||
BUILD_ARG_NAME=$(echo ${{ github.event.inputs.package }} | sed 's/\-/_/g')
|
BUILD_ARG_NAME=$(echo ${{ inputs.package }} | sed 's/\-/_/g')
|
||||||
BUILD_ARG_VALUE=$(echo ${{ github.event.inputs.package }} | sed 's/postgres/core/g')
|
BUILD_ARG_VALUE=$(echo ${{ inputs.package }} | sed 's/postgres/core/g')
|
||||||
echo "build_arg_name=$BUILD_ARG_NAME" >> $GITHUB_OUTPUT
|
echo "build_arg_name=$BUILD_ARG_NAME" >> $GITHUB_OUTPUT
|
||||||
echo "build_arg_value=$BUILD_ARG_VALUE" >> $GITHUB_OUTPUT
|
echo "build_arg_value=$BUILD_ARG_VALUE" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
@@ -83,36 +97,36 @@ jobs:
|
|||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push MAJOR.MINOR.PATCH tag
|
- name: Build and push MAJOR.MINOR.PATCH tag
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
file: docker/Dockerfile
|
file: docker/Dockerfile
|
||||||
push: True
|
push: True
|
||||||
target: ${{ github.event.inputs.package }}
|
target: ${{ inputs.package }}
|
||||||
build-args: |
|
build-args: |
|
||||||
${{ steps.build_arg.outputs.build_arg_name }}_ref=${{ steps.build_arg.outputs.build_arg_value }}@v${{ github.event.inputs.version_number }}
|
${{ steps.build_arg.outputs.build_arg_name }}_ref=${{ steps.build_arg.outputs.build_arg_value }}@v${{ steps.semver.outputs.version }}
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/dbt-labs/${{ github.event.inputs.package }}:${{ github.event.inputs.version_number }}
|
ghcr.io/dbt-labs/${{ inputs.package }}:${{ steps.semver.outputs.version }}
|
||||||
|
|
||||||
- name: Build and push MINOR.latest tag
|
- name: Build and push MINOR.latest tag
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v4
|
||||||
if: ${{ needs.get_version_meta.outputs.minor_latest == 'True' }}
|
if: ${{ needs.get_version_meta.outputs.minor_latest == 'True' }}
|
||||||
with:
|
with:
|
||||||
file: docker/Dockerfile
|
file: docker/Dockerfile
|
||||||
push: True
|
push: True
|
||||||
target: ${{ github.event.inputs.package }}
|
target: ${{ inputs.package }}
|
||||||
build-args: |
|
build-args: |
|
||||||
${{ steps.build_arg.outputs.build_arg_name }}_ref=${{ steps.build_arg.outputs.build_arg_value }}@v${{ github.event.inputs.version_number }}
|
${{ steps.build_arg.outputs.build_arg_name }}_ref=${{ steps.build_arg.outputs.build_arg_value }}@v${{ steps.semver.outputs.version }}
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/dbt-labs/${{ github.event.inputs.package }}:${{ needs.get_version_meta.outputs.major }}.${{ needs.get_version_meta.outputs.minor }}.latest
|
ghcr.io/dbt-labs/${{ inputs.package }}:${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}.latest
|
||||||
|
|
||||||
- name: Build and push latest tag
|
- name: Build and push latest tag
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v4
|
||||||
if: ${{ needs.get_version_meta.outputs.latest == 'True' }}
|
if: ${{ needs.get_version_meta.outputs.latest == 'True' }}
|
||||||
with:
|
with:
|
||||||
file: docker/Dockerfile
|
file: docker/Dockerfile
|
||||||
push: True
|
push: True
|
||||||
target: ${{ github.event.inputs.package }}
|
target: ${{ inputs.package }}
|
||||||
build-args: |
|
build-args: |
|
||||||
${{ steps.build_arg.outputs.build_arg_name }}_ref=${{ steps.build_arg.outputs.build_arg_value }}@v${{ github.event.inputs.version_number }}
|
${{ steps.build_arg.outputs.build_arg_name }}_ref=${{ steps.build_arg.outputs.build_arg_value }}@v${{ steps.semver.outputs.version }}
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/dbt-labs/${{ github.event.inputs.package }}:latest
|
ghcr.io/dbt-labs/${{ inputs.package }}:latest
|
||||||
|
|||||||
19
.github/workflows/release.yml
vendored
19
.github/workflows/release.yml
vendored
@@ -7,6 +7,7 @@
|
|||||||
# - run unit and integration tests against given commit;
|
# - run unit and integration tests against given commit;
|
||||||
# - build and package that SHA;
|
# - build and package that SHA;
|
||||||
# - release it to GitHub and PyPI with that specific build;
|
# - release it to GitHub and PyPI with that specific build;
|
||||||
|
# - call Docker image release workflow (not run for testing)
|
||||||
#
|
#
|
||||||
# **why?**
|
# **why?**
|
||||||
# Ensure an automated and tested release process
|
# Ensure an automated and tested release process
|
||||||
@@ -209,6 +210,24 @@ jobs:
|
|||||||
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
||||||
|
|
||||||
|
docker-core-release:
|
||||||
|
name: Docker dbt-core Release
|
||||||
|
if: ${{ !inputs.test_run }}
|
||||||
|
needs: [pypi-release]
|
||||||
|
|
||||||
|
uses: dbt-labs/dbt-core/.github/workflows/release-docker.yml@main
|
||||||
|
with:
|
||||||
|
package: dbt-core
|
||||||
|
|
||||||
|
docker-postgres-release:
|
||||||
|
name: Docker dbt-postgres Release
|
||||||
|
if: ${{ !inputs.test_run }}
|
||||||
|
needs: [docker-core-release]
|
||||||
|
|
||||||
|
uses: dbt-labs/dbt-core/.github/workflows/release-docker.yml@main
|
||||||
|
with:
|
||||||
|
package: dbt-postgres
|
||||||
|
|
||||||
slack-notification:
|
slack-notification:
|
||||||
name: Slack Notification
|
name: Slack Notification
|
||||||
if: ${{ failure() && (!inputs.test_run || inputs.nightly_release) }}
|
if: ${{ failure() && (!inputs.test_run || inputs.nightly_release) }}
|
||||||
|
|||||||
Reference in New Issue
Block a user