Skip to content

Commit 5cff2f5

Browse files
committed
Complete Phase 3: Single-package strategy with JRE bundling
- Simplified build system to single package (arcadedb-embedded) - Updated all 4 CI/CD workflows for 5-platform support - Corrected package sizes (162MB wheel, ~240MB installed) - Single PyPI environment (removed dual publish jobs) - Updated all documentation (README, docs, distributions) - Removed all variant logic from build system - Added TODO.md tracking all changes
1 parent 08af9c9 commit 5cff2f5

23 files changed

Lines changed: 1382 additions & 2086 deletions

.github/workflows/deploy-python-docs.yml

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
name: Deploy MkDocs to GitHub Pages
22

33
on:
4-
release:
5-
types: [published] # Trigger when GitHub Release is published
6-
# Release tag should contain 'python' (case-insensitive, e.g., v25.9.1-python, v1.0.0-Python)
4+
# Deploy docs when a version tag is pushed (e.g., 25.10.1, 25.10.1.post0)
5+
# Skip .devN versions (e.g., 25.10.1.dev0)
6+
push:
7+
tags:
8+
- '[0-9]+.[0-9]+.[0-9]+*'
79

810
# Allow manual trigger for testing
911
workflow_dispatch:
1012
inputs:
1113
version:
12-
description: 'Version to deploy (e.g., 25.9.1 or dev)'
14+
description: 'Version to deploy (e.g., 25.10.1, 25.10.1.post0)'
1315
required: true
14-
default: 'dev'
1516
set_latest:
1617
description: 'Set as latest version?'
1718
required: true
@@ -36,84 +37,73 @@ jobs:
3637
url: https://humemai.github.io/arcadedb-embedded-python/
3738

3839
steps:
39-
- name: Check if this is a Python release
40-
if: github.event_name == 'release'
41-
id: check-python-release
40+
- name: Check if this is a dev version (skip deployment)
41+
if: github.event_name != 'workflow_dispatch'
42+
id: check-dev-version
4243
run: |
43-
TAG_NAME="${{ github.event.release.tag_name }}"
44-
TAG_LOWER=$(echo "$TAG_NAME" | tr '[:upper:]' '[:lower:]')
44+
VERSION="${{ github.ref_name }}"
45+
echo "📦 Tag version: $VERSION"
4546
46-
if [[ "$TAG_LOWER" == *"python"* ]]; then
47-
echo "✅ This is a Python release: $TAG_NAME"
48-
echo "is-python-release=true" >> $GITHUB_OUTPUT
47+
# Check if version contains .dev (e.g., 25.10.1.dev0)
48+
if [[ "$VERSION" == *.dev* ]]; then
49+
echo "⏭️ This is a dev version ($VERSION), skipping docs deployment"
50+
echo "is-dev=true" >> $GITHUB_OUTPUT
4951
else
50-
echo "⏭️ Not a Python release (tag: $TAG_NAME), skipping docs deployment"
51-
echo "is-python-release=false" >> $GITHUB_OUTPUT
52-
exit 0
52+
echo "✅ This is a stable/post version ($VERSION), deploying docs"
53+
echo "is-dev=false" >> $GITHUB_OUTPUT
5354
fi
5455
55-
- name: Skip workflow for non-Python releases
56-
if: github.event_name == 'release' && steps.check-python-release.outputs.is-python-release != 'true'
56+
- name: Skip workflow for dev versions
57+
if: github.event_name != 'workflow_dispatch' && steps.check-dev-version.outputs.is-dev == 'true'
5758
run: |
58-
echo "This is not a Python release, exiting gracefully"
59+
echo "This is a dev version, exiting gracefully"
5960
exit 0
6061
6162
- name: Checkout repository
62-
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
63+
if: github.event_name == 'workflow_dispatch' || steps.check-dev-version.outputs.is-dev != 'true'
6364
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6465
with:
6566
fetch-depth: 0 # Full history for mike versioning
6667
token: ${{ secrets.GITHUB_TOKEN }}
6768

6869
- name: Set up Python
69-
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
70+
if: github.event_name == 'workflow_dispatch' || steps.check-dev-version.outputs.is-dev != 'true'
7071
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
7172
with:
7273
python-version: '3.11'
7374
cache: 'pip'
7475

7576
- name: Install dependencies
76-
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
77+
if: github.event_name == 'workflow_dispatch' || steps.check-dev-version.outputs.is-dev != 'true'
7778
working-directory: bindings/python
7879
run: |
7980
pip install --upgrade pip
8081
pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mike
8182
8283
- name: Configure Git
83-
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
84+
if: github.event_name == 'workflow_dispatch' || steps.check-dev-version.outputs.is-dev != 'true'
8485
run: |
8586
git config user.name "github-actions[bot]"
8687
git config user.email "github-actions[bot]@users.noreply.github.com"
8788
88-
- name: Extract version from release tag or input
89-
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
89+
- name: Extract version from tag or input
90+
if: github.event_name == 'workflow_dispatch' || steps.check-dev-version.outputs.is-dev != 'true'
9091
id: version
9192
run: |
9293
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
9394
VERSION="${{ github.event.inputs.version }}"
9495
SET_LATEST="${{ github.event.inputs.set_latest }}"
9596
else
96-
# Extract version from release tag (v25.9.1-python -> 25.9.1 or v25.9.1.1-python -> 25.9.1.1)
97-
TAG_NAME="${{ github.event.release.tag_name }}"
98-
TAG_LOWER=$(echo "$TAG_NAME" | tr '[:upper:]' '[:lower:]')
99-
100-
# Verify tag contains 'python' (case-insensitive)
101-
if [[ ! "$TAG_LOWER" == *"python"* ]]; then
102-
echo "❌ Release tag should contain 'python' (case-insensitive), got: $TAG_NAME"
103-
exit 1
104-
fi
105-
106-
# Strip 'v' prefix and remove everything after and including '-python' or '-Python', etc.
107-
VERSION="${TAG_NAME#v}" # Remove 'v' prefix
108-
VERSION="${VERSION%%-[Pp][Yy][Tt][Hh][Oo][Nn]*}" # Remove '-python' suffix (case-insensitive)
97+
# Extract version from tag (e.g., 25.10.1, 25.10.1.post0)
98+
VERSION="${{ github.ref_name }}"
10999
SET_LATEST="true"
110100
fi
111101
echo "version=$VERSION" >> $GITHUB_OUTPUT
112102
echo "set_latest=$SET_LATEST" >> $GITHUB_OUTPUT
113103
echo "📦 Deploying documentation version: $VERSION"
114104
115105
- name: Deploy with mike (set as latest)
116-
if: (github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true') && steps.version.outputs.set_latest == 'true'
106+
if: (github.event_name == 'workflow_dispatch' || steps.check-dev-version.outputs.is-dev != 'true') && steps.version.outputs.set_latest == 'true'
117107
working-directory: bindings/python
118108
run: |
119109
mike deploy --push --update-aliases \
@@ -122,7 +112,7 @@ jobs:
122112
mike set-default --push latest
123113
124114
- name: Deploy with mike (not latest)
125-
if: (github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true') && steps.version.outputs.set_latest != 'true'
115+
if: (github.event_name == 'workflow_dispatch' || steps.check-dev-version.outputs.is-dev != 'true') && steps.version.outputs.set_latest != 'true'
126116
working-directory: bindings/python
127117
run: |
128118
mike deploy --push \
Lines changed: 128 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,174 @@
11
name: Build and Release Python Packages to PyPI
22

33
on:
4-
release:
5-
types: [published] # Trigger when GitHub Release is published
6-
# Release tag must match 'v*-python' (e.g., v3.0.5-python)
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+*' # Matches: 25.10.1, 25.10.1.dev0, 25.10.1.post1, etc.
77

88
jobs:
9-
# Check if this is a Python release
10-
check-release:
11-
name: Validate Python Release Tag
9+
# Validate version compatibility between tag and pom.xml
10+
validate-version:
11+
name: Validate Version Compatibility
1212
runs-on: ubuntu-latest
1313
outputs:
14-
is-python-release: ${{ steps.check.outputs.is-python-release }}
14+
python-version: ${{ steps.validate.outputs.python-version }}
15+
base-version: ${{ steps.validate.outputs.base-version }}
1516
steps:
16-
- name: Check if release tag contains 'python' (case-insensitive)
17-
id: check
17+
- name: Checkout code
18+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Validate version compatibility
26+
id: validate
1827
run: |
19-
TAG_NAME="${{ github.event.release.tag_name }}"
20-
TAG_LOWER=$(echo "$TAG_NAME" | tr '[:upper:]' '[:lower:]')
21-
22-
if [[ "$TAG_LOWER" == *"python"* ]]; then
23-
echo "✅ This is a Python release: $TAG_NAME"
24-
echo "is-python-release=true" >> $GITHUB_OUTPUT
25-
else
26-
echo "⏭️ Not a Python release (tag: $TAG_NAME), skipping workflow"
27-
echo "is-python-release=false" >> $GITHUB_OUTPUT
28+
cd bindings/python
29+
30+
# Get version from git tag
31+
TAG_VERSION="${{ github.ref_name }}"
32+
echo "📌 Git tag version: $TAG_VERSION"
33+
34+
# Extract base version from tag (remove .dev0, .post1, etc.)
35+
TAG_BASE=$(echo "$TAG_VERSION" | sed -E 's/\.(dev|post|rc|a|b)[0-9]+$//')
36+
echo "📌 Tag base version: $TAG_BASE"
37+
38+
# Get version from pom.xml
39+
POM_VERSION=$(python3 extract_version.py --format=docker)
40+
echo "📌 pom.xml version: $POM_VERSION"
41+
42+
# Extract base version from pom.xml (remove -SNAPSHOT, etc.)
43+
POM_BASE=$(echo "$POM_VERSION" | sed 's/-SNAPSHOT$//' | sed 's/-RC.*//')
44+
echo "📌 pom.xml base version: $POM_BASE"
45+
46+
# Compare base versions
47+
if [ "$TAG_BASE" != "$POM_BASE" ]; then
48+
echo "❌ Version mismatch!"
49+
echo " Tag base version: $TAG_BASE"
50+
echo " pom.xml base version: $POM_BASE"
51+
echo ""
52+
echo "This prevents accidentally releasing the wrong version."
53+
echo "For example, tagging 25.9.1.dev0 when pom.xml says 25.10.1-SNAPSHOT"
54+
exit 1
2855
fi
2956
30-
# Run tests first to ensure quality
57+
echo "✅ Version compatibility check passed!"
58+
echo " Base version: $TAG_BASE"
59+
echo " Full tag version: $TAG_VERSION"
60+
61+
# Output for later jobs
62+
echo "python-version=$TAG_VERSION" >> $GITHUB_OUTPUT
63+
echo "base-version=$TAG_BASE" >> $GITHUB_OUTPUT
64+
65+
# Run example tests before building (workflow_call)
66+
test-examples:
67+
name: Run Example Tests
68+
needs: validate-version
69+
uses: ./.github/workflows/test-python-examples.yml
70+
secrets: inherit
71+
72+
# Run unit tests before building
3173
test:
32-
name: Run Tests Before Release
33-
needs: check-release
34-
if: needs.check-release.outputs.is-python-release == 'true'
74+
name: Run Unit Tests
75+
needs: validate-version
3576
uses: ./.github/workflows/test-python-bindings.yml
3677
secrets: inherit
3778

3879
build:
39-
needs: test # Wait for tests to pass
40-
name: Build Python Package (${{ matrix.variant }})
80+
needs: [validate-version, test, test-examples] # Wait for validation and tests
81+
name: Build arcadedb-embedded (${{ matrix.platform }})
4182
runs-on: ubuntu-latest
83+
environment: pypi
4284
strategy:
4385
matrix:
44-
variant: [base] # Only base variant for now, jre coming soon
45-
include:
46-
- variant: base
47-
environment: pypi-base
86+
platform: [linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64]
4887

4988
steps:
5089
- name: Checkout code
5190
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5291

92+
- name: Set up Python
93+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
94+
with:
95+
python-version: '3.11'
96+
97+
- name: Set up QEMU (for ARM64 emulation)
98+
if: contains(matrix.platform, 'arm64')
99+
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
100+
with:
101+
platforms: arm64
102+
53103
- name: Set up Docker Buildx
54104
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
55105

56-
- name: Build ${{ matrix.variant }} variant
106+
- name: Write version file for Docker build
107+
run: |
108+
cd bindings/python
109+
# Use tag version directly - pass it to extract_version.py
110+
echo "${{ needs.validate-version.outputs.python-version }}" > .build_version.txt
111+
echo "📦 Building version: ${{ needs.validate-version.outputs.python-version }}"
112+
113+
- name: Build arcadedb-embedded (${{ matrix.platform }})
57114
run: |
58115
cd bindings/python
59-
./build-all.sh ${{ matrix.variant }}
116+
# Build script will use .build_version.txt if it exists
117+
./build.sh ${{ matrix.platform }}
118+
env:
119+
BUILD_VERSION: ${{ needs.validate-version.outputs.python-version }}
60120

61121
- name: Upload wheel artifact
62122
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
63123
with:
64-
name: wheel-${{ matrix.variant }}
124+
name: wheel-${{ matrix.platform }}
65125
path: bindings/python/dist/*.whl
66126
retention-days: 5
67127

68-
publish-base:
128+
publish:
69129
name: Publish arcadedb-embedded to PyPI
70-
needs: [check-release, build]
71-
if: needs.check-release.outputs.is-python-release == 'true'
130+
needs: [validate-version, build]
72131
runs-on: ubuntu-latest
73-
environment: pypi-base
132+
environment: pypi
74133
permissions:
75134
id-token: write
76135
steps:
77-
- name: Download base wheel
136+
- name: Download all wheels
78137
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
79138
with:
80-
name: wheel-base
139+
pattern: wheel-*
81140
path: dist/
141+
merge-multiple: true
142+
143+
- name: Verify wheels
144+
run: |
145+
ls -lh dist/
146+
echo "📦 Wheels:"
147+
ls dist/*.whl
148+
149+
# Count wheels (should be 5: one for each platform)
150+
WHEEL_COUNT=$(ls dist/*.whl | wc -l)
151+
echo "📊 Wheel count: $WHEEL_COUNT (expected: 5)"
152+
153+
if [ "$WHEEL_COUNT" -ne 5 ]; then
154+
echo "❌ Expected 5 wheels (5 platforms), got $WHEEL_COUNT"
155+
exit 1
156+
fi
157+
158+
- name: Verify wheel versions
159+
run: |
160+
for WHEEL_FILE in dist/*.whl; do
161+
echo "📦 Checking: $WHEEL_FILE"
162+
# Extract version from wheel filename
163+
WHEEL_VERSION=$(echo "$WHEEL_FILE" | grep -oP '\d+\.\d+\.\d+(\.(dev|post|rc|a|b)\d+)?')
164+
echo " Version: $WHEEL_VERSION"
165+
166+
if [ "$WHEEL_VERSION" != "${{ needs.validate-version.outputs.python-version }}" ]; then
167+
echo "❌ Wheel version mismatch in $WHEEL_FILE!"
168+
exit 1
169+
fi
170+
done
171+
echo "✅ All wheel versions match tag version"
172+
82173
- name: Publish to PyPI
83174
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1

0 commit comments

Comments
 (0)