Skip to content

declare outputs

declare outputs #485

Workflow file for this run

# This workflow builds the python package.
# On release tags, it also publishes to PyPI and DockerHub.
# If we rename the workflow file name, we have to also update the
# Trusted Publisher settings on PyPI.
name: Packaging and Publishing
on:
push:
workflow_dispatch:
inputs:
version:
description: "The version to publish, ie 1.0.0 or 1.0.0-dev1"
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'workflow_dispatch' && format('v{0}', github.event.inputs.version) || github.ref }}
- uses: hynek/build-and-inspect-python-package@v2
- uses: actions/upload-artifact@v4
with:
name: Packages-${{ github.run_id }}
path: |
/tmp/baipp/dist/*.whl
/tmp/baipp/dist/*.tar.gz
publish:
name: Publish CDK version to PyPI
runs-on: ubuntu-latest
needs: [build]
permissions:
id-token: write
contents: write
environment:
name: PyPi
url: https://pypi.org/p/airbyte
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/download-artifact@v4
with:
name: Packages-${{ github.run_id }}
path: dist
- name: Upload wheel to release
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.whl
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Publish to PyPI
uses: pypa/[email protected]