Skip to content

Commit

Permalink
Finish internal build workflow (#945)
Browse files Browse the repository at this point in the history
* Add workflow for snowflake

* Add comments and make fit conventions.

* reorder input params

* Tweaks to input params.

* Add quotes

* Add build to valid semver.

* Change python version to match Cloud.

* Finalize workflow.

* Change branch reference of workflow to main.

---------

Co-authored-by: Mila Page <[email protected]>
  • Loading branch information
VersusFacit and VersusFacit authored Mar 26, 2024
1 parent 1b5c165 commit f3aa240
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 39 deletions.
61 changes: 23 additions & 38 deletions .github/workflows/release-internal.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
name: Release internal patch
# What?
#
# Tag and release an arbitrary ref. Uploads to an internal archive for further processing.
#
# How?
#
# After checking out and testing the provided ref, the image is built and uploaded.
#
# When?
#
# Manual trigger.

name: "Release internal patch"

on:
workflow_dispatch:
Expand All @@ -7,58 +19,31 @@ on:
description: "The release version number (i.e. 1.0.0b1)"
type: string
required: true
sha:
description: "The sha to use (leave empty to use latest on main)"
type: string
required: false
package_test_command:
description: "Package test command"
type: string
default: "python -c \"import dbt.adapters.snowflake\""
required: true
dbms_name:
description: "The name of the warehouse the adapter connects to."
type: string
default: "snowflake"
required: true
workflow_call:
inputs:
version_number:
description: "The release version number (i.e. 1.0.0b1)"
ref:
description: "The ref (sha or branch name) to use"
type: string
default: "main"
required: true
sha:
description: "The sha to use (leave empty to use latest on main)"
type: string
required: false
package_test_command:
description: "Package test command"
type: string
default: "python -c \"import dbt.adapters.snowflake\""
required: true
dbms_name:
description: "The name of the warehouse the adapter connects to."
type: string
default: "snowflake"
required: true

defaults:
run:
shell: bash

env:
PYTHON_TARGET_VERSION: 3.11

jobs:
invoke-reusable-workflow:
name: Build and Release Internally
name: "Build and Release Internally"

uses: VersusFacit/dbt-release/.github/workflows/internal-archive-release.yml@main
uses: "dbt-labs/dbt-release/.github/workflows/internal-archive-release.yml@main"

with:
version_number: ${{ inputs.version_number }}
package_test_command: ${{ inputs.package_test_command }}
dbms_name: ${{ inputs.dbms_name }}
sha: ${{ inputs.sha }}
version_number: "${{ inputs.version_number }}"
package_test_command: "${{ inputs.package_test_command }}"
dbms_name: "snowflake"
ref: "${{ inputs.ref }}"

secrets: inherit
secrets: "inherit"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def _get_plugin_version_dict():
_semver = r"""(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)"""
_pre = r"""((?P<prekind>a|b|rc)(?P<pre>\d+))?"""
_nightly = r"""(\.(?P<nightly>[a-z0-9]+)?)?"""
_version_pattern = rf"""version\s*=\s*["']{_semver}{_pre}{_nightly}["']"""
_build = r"""(\+build[0-9]+)?"""
_version_pattern = rf"""version\s*=\s*["']{_semver}{_pre}{_nightly}{_build}["']"""
with open(_version_path) as f:
match = re.search(_version_pattern, f.read().strip())
if match is None:
Expand Down

0 comments on commit f3aa240

Please sign in to comment.