|
| 1 | +name: Build & Publish Flet Extensions |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '**' |
| 7 | + # paths: |
| 8 | + # - "sdk/python/packages/flet-ads/**" |
| 9 | + tags: |
| 10 | + - '*' |
| 11 | + pull_request: |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +permissions: |
| 15 | + id-token: write |
| 16 | + contents: write |
| 17 | + |
| 18 | +env: |
| 19 | + ROOT: "${{ github.workspace }}" |
| 20 | + SDK_PYTHON: "${{ github.workspace }}/sdk/python" |
| 21 | + SCRIPTS: "${{ github.workspace }}/.github/scripts" |
| 22 | + PKG_VER: "0.2.0" |
| 23 | + BUILD_VER: "0.2.0+${{ github.run_number }}" |
| 24 | + PYPI_VER: "0.2.0.dev${{ github.run_number }}" |
| 25 | + |
| 26 | +jobs: |
| 27 | + build: |
| 28 | + name: Publish extensions |
| 29 | + runs-on: ubuntu-latest |
| 30 | + |
| 31 | + steps: |
| 32 | + - name: Checkout repository |
| 33 | + uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + fetch-depth: 0 |
| 36 | + fetch-tags: true |
| 37 | + |
| 38 | + - name: Setup uv |
| 39 | + uses: astral-sh/setup-uv@v6 |
| 40 | + |
| 41 | + - name: Filter publish-relevant changes |
| 42 | + uses: dorny/paths-filter@v3 |
| 43 | + id: changes |
| 44 | + with: |
| 45 | + filters: | |
| 46 | + ads: |
| 47 | + - "sdk/python/packages/flet-ads/**" |
| 48 | +
|
| 49 | + - name: Setup Flutter |
| 50 | + uses: kuhnroyal/flutter-fvm-config-action/setup@v3 |
| 51 | + with: |
| 52 | + path: '.fvmrc' |
| 53 | + cache: true |
| 54 | + |
| 55 | + - name: Publish flet-ads |
| 56 | + working-directory: ${{ env.SDK_PYTHON }}/packages/flet-ads |
| 57 | + run: | |
| 58 | + uv run "${SCRIPTS}/patch_pubspec_version.py" "src/flutter/*/pubspec.yaml" $PKG_VER |
| 59 | + dart pub get && dart analyze |
| 60 | +
|
| 61 | + uv version "$PYPI_VER" |
| 62 | + uv build |
| 63 | + ls -laR . |
| 64 | + uv publish --dry-run |
| 65 | +
|
| 66 | + - name: Upload build artifacts |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + with: |
| 69 | + name: dist |
| 70 | + path: | |
| 71 | + dist/**/*.whl |
| 72 | + dist/**/*.tar.gz |
| 73 | +
|
| 74 | +# - name: Publish Python package |
| 75 | +# if: > |
| 76 | +# startsWith(github.ref, 'refs/tags/') |
| 77 | +# || (github.ref == 'refs/heads/main' && |
| 78 | +# steps.changes.outputs.publish == 'true') |
| 79 | +# run: uv publish --dry-run |
0 commit comments