Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

refine conditions for publishing Python package in release workflow #8

refine conditions for publishing Python package in release workflow

refine conditions for publishing Python package in release workflow #8

Workflow file for this run

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-rive 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
working-directory: src/flutter/flet_rive
run: |
dart pub get
dart analyze
- name: Build Python package
run: uv build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*.whl
- name: Filter publish-relevant changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
publish:
- 'src/**'
- 'pyproject.toml'
- 'README.md'
- name: Publish Python package
if: >
github.event_name != 'pull_request' && (
startsWith(github.ref, 'refs/tags/') ||
(github.ref == 'refs/heads/main' && steps.changes.outputs.publish == 'true')
)
run: uv publish