Repository navigation
80 lines (69 loc) · 2.15 KB
/
Copy pathwheels.yml
File metadata and controls
80 lines (69 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build Wheels & Publish to PyPI
on:
pull_request:
workflow_dispatch:
release:
types: [published]
permissions:
contents: read
jobs:
build-package:
name: Build sdist
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.10'
- name: Install python dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler
pip install --upgrade pip setuptools wheel numpy pyarrow build twine
pip install --no-build-isolation .
- name: Build sdist and wheel
run: |
python -m build --sdist --wheel --no-isolation -o wheelhouse
- name: List and check sdist
run: |
ls -lh wheelhouse/
twine check wheelhouse/*
- name: Upload artifacts
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: sdist
path: ./wheelhouse/*
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:
contents: read
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
merge-multiple: true
path: wheels/
- name: List the build artifacts
run: |
ls -lAs wheels/
- name: Upload to PyPI
# zizmor: ignore[use-trusted-publishing]
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: wheels/
verify-metadata: false
verbose: true