update workflows #5
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: Build & Publish | |
| on: | |
| push: | |
| branches: | |
| - '**' # match all branches | |
| tags: | |
| - '*' # match all tags | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| build: | |
| name: Publish flet-geolocator package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # fetch all history | |
| fetch-tags: true # ensure tags are available | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Patch versions | |
| run: | | |
| source .github/scripts/update_build_version.sh | |
| uv version $PYPI_VER | |
| uv run .github/scripts/patch_pubspec_version.py src/flutter/*/pubspec.yaml $PKG_VER | |
| - name: Setup Flutter | |
| uses: kuhnroyal/flutter-fvm-config-action/setup@v3 | |
| with: | |
| path: '.fvmrc' | |
| cache: true | |
| - name: Analyze Flutter package | |
| run: | | |
| cd src/flutter/* | |
| dart pub get | |
| dart analyze | |
| cd - | |
| - name: Build Python package | |
| run: uv build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/*.whl | |
| - name: Publish Python package | |
| if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) | |
| run: uv publish |