From ca071a7bb3da83d30b9d8022e06a0fed99e6141d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20G=C3=B6kmen?= Date: Mon, 30 Sep 2024 21:06:40 -0700 Subject: [PATCH] Add PyPI publisher action --- .github/workflows/publish-pypi.yml | 38 ++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/publish-pypi.yml diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 000000000..74a8064b6 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,38 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/omnigibson + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + contents: read + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build package + run: python setup.py sdist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@v1.10.2 diff --git a/.gitignore b/.gitignore index 49737def0..67383ad6a 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,7 @@ gibson/assets notebook build dist +omnigibson.egg-info # Directories used for QC pipeline omnigibson/utils/data_utils/mesh_decimation/collision