publish #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| gitref: | |
| type: string | |
| description: "what git tag to build (e.g. v2.0.2)" | |
| required: true | |
| jobs: | |
| build: | |
| name: "Build and upload wheels" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.gitref }} | |
| fetch-tags: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Build client | |
| run: | | |
| cd client | |
| npm install | |
| npm run build | |
| cd .. | |
| - name: Move client dist to package | |
| run: | | |
| mkdir -p pipecat_ai_small_webrtc_prebuilt/client | |
| cp -r client/dist pipecat_ai_small_webrtc_prebuilt/client/ | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install development dependencies | |
| run: uv sync --group dev | |
| - name: Build project | |
| run: uv build | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels | |
| path: ./dist | |
| publish-to-pypi: | |
| name: "Publish to PyPI" | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/pipecat-ai-small-webrtc-prebuilt | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels | |
| path: ./dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| print-hash: true | |
| publish-to-test-pypi: | |
| name: "Publish to Test PyPI" | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/p/pipecat-ai-small-webrtc-prebuilt | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels | |
| path: ./dist | |
| - name: Publish to Test PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| print-hash: true | |
| repository-url: https://test.pypi.org/legacy/ |