From aa0cb8ea7fcc8655a30a1e51dbafdd13b272edd0 Mon Sep 17 00:00:00 2001 From: Sepehr Karimiziarani <112987653+sepehrkrz@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:01:16 -0500 Subject: [PATCH] Create python-publish.yml --- .github/workflows/python-publish.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..195188d --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,34 @@ +name: Publish nwmurl to PYPI + +on: + pull_request: + types: + - closed + +jobs: + deploy: + runs-on: ubuntu-latest + environment: production + steps: + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Print Repository URL + run: | + REPO_URL="https://github.com/${{ github.repository }}" + echo "Repository URL: $REPO_URL" + + - name: Install dependencies + run: pip install setuptools wheel + + - name: Build and deploy package + run: | + python setup.py sdist bdist_wheel + pip install twine==4.0.2 + twine upload -u '__token__' -p ${{ secrets.PYPI_API_TOKEN }} dist/*