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

Add a build workflow for the project #316

Merged
merged 1 commit into from
Sep 10, 2024
Merged
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
64 changes: 64 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Wheels & Publish to PyPI

on:
pull_request:
workflow_dispatch:
release:
types: [published]

jobs:
build-package:
name: Build sdist
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install python dependencies
run: pip install build twine

- name: Build sdist and wheel
run: |
python -m build -o wheelhouse

- name: List and check sdist
run: |
ls -lh wheelhouse/
twine check wheelhouse/*

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sdist
path: ./wheelhouse/*.tar.gz

upload_to_pypi:
name: Upload to PyPI
runs-on: ubuntu-latest
if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'workflow_dispatch')
needs: [build-package]
environment:
name: pypi
url: https://pypi.org/p/tensorflow-transform
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: wheels/

- name: List the build artifacts
run: |
ls -lAs wheels/

- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.9
with:
packages_dir: wheels/