diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..077e2bab --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,92 @@ +name: Publish Package + +on: # yamllint disable-line rule:truthy + push: + branches: + - master + release: + types: + - published + +defaults: + run: + shell: bash + +jobs: + build-package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Install build tools + run: | + pip install -U pip + pip install -U flit twine + pip list + + - name: Build package + run: | + flit build --no-use-vcs + twine check dist/* --strict + + - uses: actions/upload-artifact@v4 + with: + name: release-${{ github.sha }} + path: dist + + publish-package-test: + if: github.event_name == 'release' + runs-on: ubuntu-latest + needs: [build-package] + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Download package + uses: actions/download-artifact@v4 + with: + name: release-${{ github.sha }} + path: dist + + - name: Publish package to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + username: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + verbose: true + print-hash: true + + publish-package: + if: github.event_name == 'release' + runs-on: ubuntu-latest + needs: [publish-package-test] + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Download package + uses: actions/download-artifact@v4 + with: + name: release-${{ github.sha }} + path: dist + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + username: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + verbose: true + print-hash: true diff --git a/.gitignore b/.gitignore index 0e0c89c6..b5e64cfb 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ venv/* data/** catboost_info/ .pt_tmp/ +test_*.py diff --git a/pyproject.toml b/pyproject.toml index fe812761..c9380fe0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend="flit_core.buildapi" [project] name="pytorch-frame" -version="0.2.4" authors=[ {name="PyG Team", email="team@pyg.org"}, ] +dynamic=["version"] description="Tabular Deep Learning Library for PyTorch" readme="README.md" requires-python=">=3.9"