From ce672faad6aeb48b6c0c219244a090a8daeb6e34 Mon Sep 17 00:00:00 2001 From: Anwaar Khalid Date: Mon, 1 Apr 2024 15:41:02 +0000 Subject: [PATCH 1/2] new workflows file --- .github/workflows/pypi.yml | 54 ++++++++++++++++++++++------------ .github/workflows/testpypi.yml | 22 -------------- pyproject.toml | 2 ++ 3 files changed, 38 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/testpypi.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index e46b465..3001613 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,21 +1,39 @@ -name: Publish to PyPI -on: - release: - types: [published] +name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI + +on: push jobs: - pypi_release: - name: Builds Using Poetry and Publishes to PyPI - runs-on: ubuntu-latest - environment: pypi + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - name: Install deps - run: | - python -m pip install --upgrade pip - pip install poetry - poetry install --with dev - - run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}" - - name: Publish package - run: poetry publish --build + - uses: actions/checkout@master + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: + python-version: 3.9 + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_KEY }} + repository_url: https://test.pypi.org/legacy/ + skip_existing: true + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_KEY }} diff --git a/.github/workflows/testpypi.yml b/.github/workflows/testpypi.yml deleted file mode 100644 index 3887d7c..0000000 --- a/.github/workflows/testpypi.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish to Test PyPI -on: - push: - tags: - - '*.*.*' - -jobs: - test_pypi_release: - runs-on: ubuntu-latest - environment: pypi - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - name: Install deps - run: | - python -m pip install --upgrade pip - pip install poetry - poetry install --with dev - - run: poetry config repositories.testpypi https://test.pypi.org/legacy/ - - run: poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_KEY }} - - name: Publish package - run: poetry publish --build -r testpypi diff --git a/pyproject.toml b/pyproject.toml index b13d475..371f7ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,10 @@ [tool.poetry] name = "unifyai" version = "0.1.0" +readme = "README.md description = "A Python package for interacting with the Unify API" authors = ["Unify "] +repository = "https://github.com/unifyai/unify-llm-python" [tool.poetry.dependencies] python = "^3.9" From f9c7e687833fc176e1bc50cbbed04940a3a3cdd4 Mon Sep 17 00:00:00 2001 From: Anwaar Khalid Date: Mon, 1 Apr 2024 15:48:59 +0000 Subject: [PATCH 2/2] minor fix --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 371f7ed..3056c1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "unifyai" version = "0.1.0" -readme = "README.md +readme = "README.md" description = "A Python package for interacting with the Unify API" authors = ["Unify "] repository = "https://github.com/unifyai/unify-llm-python"