From 88ce52f0304c39ffe95e2c10c23b6e5e199dacc8 Mon Sep 17 00:00:00 2001 From: Celyn Walters <3299161+celynw@users.noreply.github.com> Date: Mon, 29 Jan 2024 01:46:00 +0000 Subject: [PATCH] Publish to Pypi after releasing the draft release --- .github/workflows/main.yml | 25 +------------------------ .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ce8243..c85f120 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,32 +41,9 @@ jobs: - name: Unit tests run: pytest --disable-warnings -vvs kellog/tests - publish: - name: Publish to PyPI - needs: test - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.8 - - name: Install with dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - release: name: Create release - needs: publish + needs: test runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..832e43b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Publish Release +on: + release: + types: [published] + +jobs: + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + - name: Install with dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file