|
| 1 | +name: Build and Release Python Packages to PyPI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'python-*' # Triggers on tags like python-25.9.1 |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + name: Build Python Distribution (${{ matrix.distribution }}) |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + distribution: [headless, minimal, full] |
| 15 | + include: |
| 16 | + - distribution: headless |
| 17 | + environment: pypi-headless |
| 18 | + - distribution: minimal |
| 19 | + environment: pypi-minimal |
| 20 | + - distribution: full |
| 21 | + environment: pypi-full |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout code |
| 25 | + uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - name: Set up Docker Buildx |
| 28 | + uses: docker/setup-buildx-action@v3 |
| 29 | + |
| 30 | + - name: Build ${{ matrix.distribution }} distribution |
| 31 | + run: | |
| 32 | + cd bindings/python |
| 33 | + ./build-all.sh ${{ matrix.distribution }} |
| 34 | + |
| 35 | + - name: Upload wheel artifact |
| 36 | + uses: actions/upload-artifact@v4 |
| 37 | + with: |
| 38 | + name: wheel-${{ matrix.distribution }} |
| 39 | + path: bindings/python/dist/*.whl |
| 40 | + retention-days: 5 |
| 41 | + |
| 42 | + publish-headless: |
| 43 | + name: Publish arcadedb-embedded-headless to PyPI |
| 44 | + needs: build |
| 45 | + runs-on: ubuntu-latest |
| 46 | + environment: pypi-headless |
| 47 | + permissions: |
| 48 | + id-token: write |
| 49 | + steps: |
| 50 | + - name: Download headless wheel |
| 51 | + uses: actions/download-artifact@v4 |
| 52 | + with: |
| 53 | + name: wheel-headless |
| 54 | + path: dist/ |
| 55 | + - name: Publish to PyPI |
| 56 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 57 | + |
| 58 | + publish-minimal: |
| 59 | + name: Publish arcadedb-embedded-minimal to PyPI |
| 60 | + needs: build |
| 61 | + runs-on: ubuntu-latest |
| 62 | + environment: pypi-minimal |
| 63 | + permissions: |
| 64 | + id-token: write |
| 65 | + steps: |
| 66 | + - name: Download minimal wheel |
| 67 | + uses: actions/download-artifact@v4 |
| 68 | + with: |
| 69 | + name: wheel-minimal |
| 70 | + path: dist/ |
| 71 | + - name: Publish to PyPI |
| 72 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 73 | + |
| 74 | + publish-full: |
| 75 | + name: Publish arcadedb-embedded to PyPI |
| 76 | + needs: build |
| 77 | + runs-on: ubuntu-latest |
| 78 | + environment: pypi-full |
| 79 | + permissions: |
| 80 | + id-token: write |
| 81 | + steps: |
| 82 | + - name: Download full wheel |
| 83 | + uses: actions/download-artifact@v4 |
| 84 | + with: |
| 85 | + name: wheel-full |
| 86 | + path: dist/ |
| 87 | + - name: Publish to PyPI |
| 88 | + uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments