From a35c2f98721448a50611bd20db954d9206c024d2 Mon Sep 17 00:00:00 2001 From: xpai Date: Wed, 6 Nov 2024 20:44:46 +0800 Subject: [PATCH] Update pypi workflow --- .github/workflows/pypi.yml | 37 ++++++------------- ...test_torch_layers_bilinear_interaction.py} | 0 2 files changed, 12 insertions(+), 25 deletions(-) rename tests/unit_tests/{test_pytorch_layers_bilinear_interaction.py => test_torch_layers_bilinear_interaction.py} (100%) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 46c50f2..c6aee66 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -7,38 +7,25 @@ on: workflow_dispatch: jobs: - build: - name: Build wheel distribution + pypi-publish: + name: Build package wheel and upload to pypi runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.7 - - name: Build a binary wheel and a source tarball + python-version: 3.9 + - name: Build package wheel and source tarball run: | pip install wheel python setup.py sdist bdist_wheel - - name: Store the distribution packages - uses: actions/upload-artifact@v3 + - name: Publish package distributions to pypi + uses: pypa/gh-action-pypi-publish@release/v1 with: - name: python-package-distributions - path: dist/ - - pypi-publish: - name: upload to pypi - runs-on: ubuntu-latest - # Specifying a GitHub environment is optional, but strongly encouraged - environment: release - permissions: - # IMPORTANT: this permission is mandatory for trusted publishing - id-token: write - steps: - - name: Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: Publish package distributions to pypi - uses: pypa/gh-action-pypi-publish@release/v1 + packages-dir: dist/ diff --git a/tests/unit_tests/test_pytorch_layers_bilinear_interaction.py b/tests/unit_tests/test_torch_layers_bilinear_interaction.py similarity index 100% rename from tests/unit_tests/test_pytorch_layers_bilinear_interaction.py rename to tests/unit_tests/test_torch_layers_bilinear_interaction.py