From 2598e8d139bb5ebfe52e21cedaf4ff32d71ffa14 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 11 Oct 2023 18:35:03 -0700 Subject: [PATCH] ci: :green_heart: publish to pypi in seperate step --- .github/workflows/preview.yaml | 53 +++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index ea810aa0e..63974443f 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -6,6 +6,48 @@ on: - preview jobs: + pypi-deployment: + runs-on: ubuntu-20.04 + permissions: + contents: write + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10.8" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install poetry + + - name: Install project dependencies + run: cd server && poetry install + + - name: Configure Poetry Token + run: cd server && poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} + + - name: Bump the version + run: cd server && poetry version patch + + - name: Build and publish the package + run: cd server && poetry publish --build + + - name: Commit changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -am "ci: 🏷 Update PyPI version [skip ci]" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + build: strategy: matrix: @@ -73,17 +115,6 @@ jobs: - name: Build PyInstaller Executable run: pyinstaller continue_server.spec - # 1.25 Publish to PyPI - - - name: Configure Poetry Token - run: cd server && poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} - - - name: Bump the version - run: cd server && poetry version patch - - - name: Build and publish the package - run: cd server && poetry publish --build - # 1.5 Place the binary in extension/exe directory - name: Make sure extension/exe directory exists run: |