-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb53992
commit 9b5d4f8
Showing
4 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
import pathlib | ||
import sys | ||
|
||
import yaml | ||
|
||
if len(sys.argv) < 3: | ||
print("Specify pubspec.yaml file and version to patch") | ||
sys.exit(1) | ||
|
||
current_dir = pathlib.Path(os.getcwd()) | ||
pubspec_path = current_dir.joinpath(current_dir, sys.argv[1]) | ||
ver = sys.argv[2] | ||
print(f"Patching pubspec.yaml file {pubspec_path} with {ver}") | ||
|
||
dependencies = [ | ||
"flet", | ||
] | ||
|
||
with open(pubspec_path, "r") as f: | ||
data = yaml.safe_load(f) | ||
|
||
# patch version | ||
data["version"] = ver | ||
|
||
with open(pubspec_path, "w") as file: | ||
yaml.dump(data, file, sort_keys=False) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
import pathlib | ||
import sys | ||
|
||
import tomlkit | ||
|
||
if len(sys.argv) < 3: | ||
print("Specify toml file and version to patch") | ||
sys.exit(1) | ||
|
||
current_dir = pathlib.Path(os.getcwd()) | ||
toml_path = current_dir.joinpath(current_dir, sys.argv[1]) | ||
ver = sys.argv[2] | ||
print(f"Patching TOML file {toml_path} to {ver}") | ||
|
||
# read | ||
with open(toml_path, "r") as f: | ||
t = tomlkit.parse(f.read()) | ||
|
||
# patch version | ||
t["project"]["version"] = ver | ||
|
||
# save | ||
with open(toml_path, "w") as f: | ||
f.write(tomlkit.dumps(t)) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
if [ -n "$APPVEYOR_REPO_TAG_NAME" ]; then | ||
export PKG_VER="${APPVEYOR_REPO_TAG_NAME#v}" # Remove the 'v' prefix | ||
export BUILD_VER="$PKG_VER" | ||
else | ||
# Get the latest Git tag and handle missing tags gracefully | ||
cv=$(git describe --abbrev=0 2>/dev/null || echo "v0.0.0") # Default to v1.0.0 if no tag | ||
cv=${cv#v} # Remove the 'v' prefix if present | ||
major=$(echo "$cv" | cut -d. -f1) | ||
minor=$(echo "$cv" | cut -d. -f2) | ||
minor=$((minor + 1)) | ||
export PKG_VER="${major}.${minor}.0" | ||
export BUILD_VER="${PKG_VER}+${APPVEYOR_BUILD_NUMBER}" | ||
fi | ||
export PYPI_VER="${BUILD_VER/+/.dev}" | ||
appveyor UpdateBuild -Version $BUILD_VER |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
image: ubuntu | ||
|
||
version: '0.1.{build}' | ||
|
||
environment: | ||
UV_PUBLISH_TOKEN: | ||
secure: 174ncAbF5IjSIkmioPt62jeSnzmTlRNchUkE4QdjDWH8xK1olYtySXLJpo2q95HcP7lWJky1hv4APESiRRHnBWoY0XRFafzM/mbCDMzG1tZXiXZmpP1qzHAtRP2QSCIg18xh1TMktraUdTi7sbJnjjRhqzgbW1k0kLBxKw79MPFBhYQ/TiGcmaYWZbWVZNY3HCUCb6Dt7bG1OE2Ul9rD1gvs55xwO9Oq9FOVA1VnMYw= | ||
|
||
stack: | ||
- python 3.12 | ||
|
||
install: | ||
- source .ci/update_build_version.sh | ||
- python --version | ||
- python -m ensurepip --upgrade | ||
- pip3 install --upgrade tomlkit pyyaml | ||
- curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- export PATH=$HOME/.local/bin:$PATH | ||
|
||
build_script: | ||
- python .ci/patch_toml_version.py pyproject.toml $PYPI_VER | ||
- python .ci/patch_pubspec_version.py src/flutter/flet_*/pubspec.yaml $PKG_VER | ||
- uv build | ||
|
||
deploy_script: | ||
- sh: | | ||
if [[ ("$APPVEYOR_REPO_BRANCH" == "main" || "$APPVEYOR_REPO_TAG_NAME" != "") && "$APPVEYOR_PULL_REQUEST_NUMBER" == "" ]]; then | ||
uv publish | ||
fi | ||
artifacts: | ||
- path: dist/*.whl | ||
|
||
test: off |