From fb3904597cf0e2303e8532a21a10a7f02bf2e87c Mon Sep 17 00:00:00 2001 From: Garrett Barter Date: Wed, 3 Jan 2024 04:05:27 -0700 Subject: [PATCH] adding auto publish script --- .github/workflows/Publish_RAFT.yml | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/Publish_RAFT.yml diff --git a/.github/workflows/Publish_RAFT.yml b/.github/workflows/Publish_RAFT.yml new file mode 100644 index 0000000..8245741 --- /dev/null +++ b/.github/workflows/Publish_RAFT.yml @@ -0,0 +1,46 @@ +name: Build and upload to PyPI + +# Build on every branch push, tag push, and pull request change: +#on: [push, pull_request] +# Alternatively, to publish when a (published) GitHub Release is created, use the following: +on: + push: + pull_request: + release: + types: + - published + +jobs: + build_and_upload_pypi: + runs-on: ubuntu-latest + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + # upload to PyPI on every tag starting with 'v' + #if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + # alternatively, to publish when a GitHub Release is created, use the following rule: + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - name: checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + id: cp + with: + python-version: "3.11" + update-environment: true + + - name: Install pypa/build + run: | + python -m pip install build + + - name: Build a binary wheel and a source tarball + run: | + python -m build . + + - name: Upload to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # user: __token__ + # password: ${{ secrets.pypi_password }} + # To test: repository_url: https://test.pypi.org/legacy/