diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml new file mode 100644 index 0000000..aa9c92a --- /dev/null +++ b/.github/workflows/ci-deploy.yml @@ -0,0 +1,60 @@ +name: CI/Deploy + +on: + push: + tags: ["v*"] + +jobs: + + unit: + uses: ./.github/workflows/unit.yml + + notebooks: + uses: ./.github/workflows/notebook_smoke.yml + + check_semantic_version_placeholder: + name: Check semantic version placeholder exists in the __init__ + + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v3 + + - name: Check lines exist + run: | + grep -x "__version__ = ... # semantic-version-placeholder" gpax/__init__.py + + build_and_publish: + name: Upload release to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/gpax + permissions: + id-token: write + + needs: + - check_semantic_version_placeholder + - unit + - notebooks + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Build and apply version + run: bash scripts/build_project.sh + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + # CURRENTLY USING TEST SERVER FOR NOW!!!! + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml deleted file mode 100644 index 34d5e5b..0000000 --- a/.github/workflows/publish-to-pypi.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI - -on: push - -jobs: - build: - name: Build distribution 📦 - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - name: Install pypa/build - run: >- - python3 -m - pip install - build - --user - - name: Build a binary wheel and a source tarball - run: python3 -m build - - name: Store the distribution packages - uses: actions/upload-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - # publish-to-pypi: - # name: >- - # Publish Python 🐍 distribution 📦 to PyPI - # if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes - # needs: - # - build - # runs-on: ubuntu-latest - # environment: - # name: pypi - # url: https://pypi.org/p/gpax - # permissions: - # id-token: write # IMPORTANT: mandatory for trusted publishing - # - # steps: - # - name: Download all the dists - # uses: actions/download-artifact@v3 - # with: - # name: python-package-distributions - # path: dist/ - # - name: Publish distribution 📦 to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1