File tree Expand file tree Collapse file tree 2 files changed +90
-0
lines changed
Expand file tree Collapse file tree 2 files changed +90
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Reusable action which builds struct2tensor
2+
3+ inputs :
4+ python-version :
5+ description : ' Python version'
6+ required : true
7+ runs :
8+ using : ' composite'
9+ steps :
10+ - name : Build the package for Python ${{ inputs.python-version }}
11+ shell : bash
12+ run : |
13+ docker compose build --build-arg PYTHON_VERSION=${{ inputs.python-version }} manylinux2014
14+ docker compose run -e TF_VERSION=RELEASED_TF_2 manylinux2014
15+ bazel build -c opt struct2tensor:struct2tensor_kernels_and_ops
16+
17+ - name : Upload wheel artifact for Python ${{ inputs.python-version }}
18+ uses : actions/upload-artifact@v4
19+ with :
20+ name : ml-metadata-wheel-py${{ inputs.python-version }}
21+ path : dist/*.whl
Original file line number Diff line number Diff line change 1+ name : Build struct2tensor wheels
2+
3+ on :
4+ pull_request :
5+ workflow_dispatch :
6+ release :
7+ types : [published]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ strategy :
13+ matrix :
14+ python-version : ["3.9", "3.10", "3.11"]
15+
16+ steps :
17+ - name : Checkout
18+ uses : actions/checkout@v4
19+
20+ - name : Build package
21+ id : build-package
22+ uses : ./.github/reusable-build
23+ with :
24+ python-version : ${{ matrix.python-version }}
25+
26+ - name : Retrieve wheels
27+ uses : actions/download-artifact@v4
28+ with :
29+ merge-multiple : true
30+ path : wheels
31+
32+ - name : Set up Python ${{ matrix.python-version }}
33+ uses : actions/setup-python@v5
34+ with :
35+ python-version : ${{ matrix.python-version }}
36+
37+ - name : List and check wheels
38+ shell : bash
39+ run : |
40+ pip install twine pkginfo>=1.10.0
41+ ${{ matrix.ls || 'ls -lh' }} wheels/
42+ twine check wheels/*
43+
44+
45+ upload_to_pypi :
46+ name : Upload to PyPI
47+ runs-on : ubuntu-latest
48+ if : (github.event_name == 'release' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'workflow_dispatch')
49+ needs : [build]
50+ environment :
51+ name : pypi
52+ url : https://pypi.org/p/ml-metadata/
53+ permissions :
54+ id-token : write
55+ steps :
56+ - name : Retrieve wheels
57+ uses : actions/download-artifact@v4
58+ with :
59+ merge-multiple : true
60+ path : wheels
61+
62+ - name : List the build artifacts
63+ run : |
64+ ls -lAs wheels/
65+
66+ - name : Upload to PyPI
67+ uses : pypa/gh-action-pypi-publish@release/v1.9
68+ with :
69+ packages_dir : wheels/
You can’t perform that action at this time.
0 commit comments