From 84f5146cbbd33ce7f4f3b2c4be0b4a75242bf6be Mon Sep 17 00:00:00 2001 From: Carson Lam Date: Fri, 11 Aug 2023 14:02:46 -0700 Subject: [PATCH] Fix release pypi actions workflow (#14) * cleaned actions * test checks on push * pypa/gh-action-pypi-publish --------- Co-authored-by: Carson Lam --- .github/workflows/upload-to-pypi.yml | 23 +++++++++++++++-------- src/together/version.py | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/upload-to-pypi.yml b/.github/workflows/upload-to-pypi.yml index 23dc5731..a5274437 100644 --- a/.github/workflows/upload-to-pypi.yml +++ b/.github/workflows/upload-to-pypi.yml @@ -1,12 +1,18 @@ name: Upload to PyPI -run-name: ${{ github.actor }} is uploading a new release of together python library client to PyPI 🚀 -on: [push] + +on: + workflow_dispatch: + inputs: + PYPI_API_TOKEN: + required: true + description: your API token on PyPI + jobs: Upload-Library-to-PyPI: runs-on: ubuntu-latest steps: - name: Check out repository code - uses: actions/checkout + uses: actions/checkout@v2 - name: To build the dist archives into the dist/ directory, first install build run: | python3 -m pip install --upgrade build @@ -16,11 +22,12 @@ jobs: - name: List files in the repository to check you have the .toml file run: | ls ${{ github.workspace }} - - name: Use `python3 -m build` to build the dist archives run + - name: Use `python3 -m build` to build the dist archives run, You will see the `dist/` folder appear in the main directory of your repository run: | python3 -m build - - name: You will see the `dist/` folder appear in the main directory of your repository - - name: Use `python3 -m twine upload dist/*` to upload the archives to PyPI. - run: | - python3 -m twine upload dist/* + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ github.event.inputs.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/src/together/version.py b/src/together/version.py index 5411c9a5..6d1f1c85 100644 --- a/src/together/version.py +++ b/src/together/version.py @@ -1 +1 @@ -VERSION = "0.1.2" +VERSION = "0.1.3"