Align master with r1.21.0 release branch and bump version to 1.22.0.dev (#246) #50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build ml-metadata with Conda | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Micromamba | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| environment-file: ${{ matrix.os == 'macos-latest' && 'ci/environment-macos.yml' || 'ci/environment.yml' }} | |
| cache-environment: true | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| - name: Display environment info | |
| shell: bash -l {0} | |
| run: | | |
| micromamba info | |
| micromamba list | |
| - name: Install Bazel | |
| shell: bash -l {0} | |
| run: | | |
| # Install Bazelisk (manages Bazel versions) | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| curl -Lo /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64 | |
| elif [ "$RUNNER_OS" == "macOS" ]; then | |
| curl -Lo /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-darwin-amd64 | |
| fi | |
| chmod +x /tmp/bazelisk | |
| sudo mv /tmp/bazelisk /usr/local/bin/bazel | |
| echo "USE_BAZEL_VERSION=7.7.0" >> $GITHUB_ENV | |
| bazel --version | |
| - name: Install build tooling | |
| shell: bash -l {0} | |
| run: | | |
| python -m pip install --upgrade pip build wheel "setuptools<69.3" | |
| - name: Build the package | |
| shell: bash -l {0} | |
| run: | | |
| rm -rf build build_mlmd_tmp dist | |
| python -m build --wheel --no-isolation | |
| - name: Repair wheel (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash -l {0} | |
| run: | | |
| python -m pip install auditwheel | |
| WHEEL_PATH="$(ls dist/*.whl)" | |
| auditwheel repair --plat auto -w dist "${WHEEL_PATH}" | |
| rm "${WHEEL_PATH}" | |
| - name: Upload wheel artifact | |
| uses: actions/upload-artifact@v4.4.0 | |
| with: | |
| name: ml-metadata-wheel-${{ matrix.os }}-py${{ matrix.python-version }} | |
| path: dist/*.whl | |
| 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] | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/ml-metadata/ | |
| steps: | |
| - name: Retrieve wheels | |
| uses: actions/download-artifact@v4.1.8 | |
| 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/ | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} |