Skip to content

Enable Trusted Publishing for PyPI actions (#1356) #4

Enable Trusted Publishing for PyPI actions (#1356)

Enable Trusted Publishing for PyPI actions (#1356) #4

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/