mirror of
https://github.com/dbt-labs/dbt-snowflake
synced 2025-12-17 19:31:31 +00:00
* disable issue creation and point users to dbt-adapters * turn off dependabot * update pull request template to point users to dbt-adapters * remove contributing guide content and point users to the monorepo * remove readme guide content and point users to the monorepo * remove scheduled main branch tests * update the branch used for nightly releases
122 lines
4.0 KiB
YAML
122 lines
4.0 KiB
YAML
# **what?**
|
|
# Nightly releases to GitHub and PyPI. This workflow produces the following outcome:
|
|
# - generate and validate data for night release (commit SHA, version number, release branch);
|
|
# - pass data to release workflow;
|
|
# - night release will be pushed to GitHub as a draft release;
|
|
# - night build will be pushed to test PyPI;
|
|
#
|
|
# **why?**
|
|
# Ensure an automated and tested release process for nightly builds
|
|
#
|
|
# **when?**
|
|
# This workflow runs on schedule or can be run manually on demand.
|
|
|
|
name: Nightly Test Release to GitHub and PyPI
|
|
|
|
on:
|
|
workflow_dispatch: # for manual triggering
|
|
schedule:
|
|
- cron: 0 9 * * *
|
|
|
|
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:
|
|
shell: bash
|
|
|
|
env:
|
|
RELEASE_BRANCH: "1.9.latest"
|
|
|
|
jobs:
|
|
aggregate-release-data:
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
commit_sha: ${{ steps.resolve-commit-sha.outputs.release_commit }}
|
|
version_number: ${{ steps.nightly-release-version.outputs.number }}
|
|
release_branch: ${{ steps.release-branch.outputs.name }}
|
|
|
|
steps:
|
|
- name: "Checkout ${{ github.repository }} Branch ${{ env.RELEASE_BRANCH }}"
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ env.RELEASE_BRANCH }}
|
|
|
|
- name: "Resolve Commit To Release"
|
|
id: resolve-commit-sha
|
|
run: |
|
|
commit_sha=$(git rev-parse HEAD)
|
|
echo "release_commit=$commit_sha" >> $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
|
|
uses: dbt-labs/actions/parse-semver@v1.1.1
|
|
with:
|
|
version: ${{ steps.version-number-sources.outputs.current_version }}
|
|
|
|
- name: "Get Current Date"
|
|
id: current-date
|
|
run: echo "date=$(date +'%m%d%Y')" >> $GITHUB_OUTPUT
|
|
|
|
# Bump to the next patch because when this is a previously released patch, the changelog
|
|
# markdown will already exist and cause a failure in another step
|
|
- name: "Bump Patch Number"
|
|
id: bump_patch
|
|
run: |
|
|
echo "patch=$((${{ steps.semver.outputs.patch }}+1))" >> $GITHUB_OUTPUT
|
|
|
|
- name: "Generate Nightly Release Version Number"
|
|
id: nightly-release-version
|
|
run: |
|
|
number="${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}.${{ steps.bump_patch.outputs.patch }}+dev${{ steps.current-date.outputs.date }}"
|
|
echo "number=$number" >> $GITHUB_OUTPUT
|
|
|
|
- name: "Audit Nightly Release Version And Parse Into Parts"
|
|
uses: dbt-labs/actions/parse-semver@v1.1.1
|
|
with:
|
|
version: ${{ steps.nightly-release-version.outputs.number }}
|
|
|
|
- name: "Set Release Branch"
|
|
id: release-branch
|
|
run: |
|
|
echo "name=${{ env.RELEASE_BRANCH }}" >> $GITHUB_OUTPUT
|
|
|
|
log-outputs-aggregate-release-data:
|
|
runs-on: ubuntu-latest
|
|
needs: [aggregate-release-data]
|
|
|
|
steps:
|
|
- name: "[DEBUG] Log Outputs"
|
|
run: |
|
|
echo commit_sha : ${{ needs.aggregate-release-data.outputs.commit_sha }}
|
|
echo version_number: ${{ needs.aggregate-release-data.outputs.version_number }}
|
|
echo release_branch: ${{ needs.aggregate-release-data.outputs.release_branch }}
|
|
|
|
release-github-pypi:
|
|
needs: [aggregate-release-data]
|
|
|
|
uses: ./.github/workflows/release.yml
|
|
with:
|
|
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
|