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

Backport updates to enable tag-based publishing for dbt-metricflow #1357

Closed
Closed
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
36 changes: 36 additions & 0 deletions .github/workflows/cd-push-dbt-metricflow-to-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish dbt-metricflow Release
on:
workflow_dispatch:
push:
# Tag format is <package>/v<pep440_semantic_version>
tags:
- "dbt-metricflow/v[0-9]+.[0-9]+.[0-9]+*"

env:
PYTHON_VERSION: "3.8"

jobs:
pypi-publish:
runs-on: ubuntu-latest
environment:
name: Pypi Publish
url: https://pypi.org/p/dbt-metricflow
permissions:
id-token: write
steps:
- name: Check-out the repo
uses: actions/checkout@v3

- name: Setup Python ${{ env.PYTHON_VERSION }} Environment
uses: ./.github/actions/setup-python-env
with:
python-version: "${{ env.PYTHON_VERSION }}"

- name: Build `dbt-metricflow` package
working-directory: ./dbt-metricflow
run: hatch build

- name: Publish `dbt-metricflow` package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dbt-metricflow/dist/
34 changes: 34 additions & 0 deletions .github/workflows/cd-push-metricflow-to-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Metricflow Release
on:
workflow_dispatch:
push:
# MetricFlow historically tagged releases with v<pep440_semantic_version>
# We restrict to this for now and assume any tag without a package identifier is MetricFlow itself
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

env:
PYTHON_VERSION: "3.8"

jobs:
pypi-publish:
runs-on: ubuntu-latest
environment:
name: Pypi Publish
url: https://pypi.org/p/metricflow
permissions:
id-token: write
steps:
- name: Check-out the repo
uses: actions/checkout@v3

- name: Setup Python ${{ env.PYTHON_VERSION }} Environment
uses: ./.github/actions/setup-python-env
with:
python-version: "${{ env.PYTHON_VERSION }}"

- name: Build `metricflow` package
run: hatch build

- name: Publish `metricflow` package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
28 changes: 0 additions & 28 deletions .github/workflows/cd-push-to-pypi.yaml

This file was deleted.

Loading