|
| 1 | +name: CI/CD |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + test: |
| 12 | + name: Test / OS ${{ matrix.os }} / Python ${{ matrix.python-version }} |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + os: [ubuntu-latest] |
| 16 | + python-version: [3.8, 3.9, "3.10", "3.11"] |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + steps: |
| 19 | + - name: Clone Repository |
| 20 | + uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - name: Set up Python ${{ matrix.python-version }} |
| 23 | + uses: actions/setup-python@v2 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + |
| 27 | + - name: Set up Poetry |
| 28 | + |
| 29 | + with: |
| 30 | + poetry-version: 1.3.2 |
| 31 | + |
| 32 | + # - name: Run Tests |
| 33 | + # env: |
| 34 | + # SUPABASE_ID: ${{ secrets.SUPABASE_ID }} |
| 35 | + # API_KEY: ${{ secrets.API_KEY }} |
| 36 | + # run: make run_tests |
| 37 | + |
| 38 | + # - name: Upload Coverage |
| 39 | + # uses: codecov/codecov-action@v1 |
| 40 | + publish: |
| 41 | + needs: test |
| 42 | + if: ${{ !startsWith(github.event.head_commit.message, 'bump') && !startsWith(github.event.head_commit.message, 'chore') && github.ref == 'refs/heads/master' && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.repository_owner == 'supabase-community' }} |
| 43 | + runs-on: ubuntu-latest |
| 44 | + name: "Bump version, create changelog and publish" |
| 45 | + environment: |
| 46 | + name: pypi |
| 47 | + url: https://pypi.org/p/realtime |
| 48 | + permissions: |
| 49 | + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing |
| 50 | + contents: write # needed for github actions bot to write to repo |
| 51 | + steps: |
| 52 | + - name: Clone Repository |
| 53 | + uses: actions/checkout@v3 |
| 54 | + with: |
| 55 | + ref: ${{ github.ref }} |
| 56 | + fetch-depth: 0 |
| 57 | + token: ${{ secrets.SILENTWORKS_PAT }} |
| 58 | + - name: Python Semantic Release |
| 59 | + id: release |
| 60 | + uses: python-semantic-release/[email protected] |
| 61 | + with: |
| 62 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + |
| 64 | + - name: Publish package distributions to PyPI |
| 65 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 66 | + # NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true. |
| 67 | + # See https://github.com/actions/runner/issues/1173 |
| 68 | + if: steps.release.outputs.released == 'true' |
| 69 | + |
| 70 | + - name: Publish package distributions to GitHub Releases |
| 71 | + uses: python-semantic-release/upload-to-gh-release@main |
| 72 | + if: steps.release.outputs.released == 'true' |
| 73 | + with: |
| 74 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments