Skip to content

Commit 88dfb02

Browse files
committed
chore: update CI workflows and add release process for Frappe version-16
- Updated CI workflows to target the version-16 branch, including changes to deployment configurations and dependencies. - Added a new workflow for creating releases that sets the __version__ to the current Frappe version from the version-16 branch. - Adjusted Python and Node.js versions in workflows to align with Frappe version-16 requirements. - Enhanced logging to capture the installed Frappe version during CI runs.
1 parent 01234d5 commit 88dfb02

5 files changed

Lines changed: 86 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
name: CI
22

3+
# Deployment branch for Frappe version-16 (Python 3.14, Node 24, MariaDB 11.8)
34
on:
45
push:
56
branches:
6-
- develop
7+
- version-16
78
paths-ignore:
89
- ".github/**"
910
pull_request:
11+
branches:
12+
- version-16
1013
paths-ignore:
1114
- ".github/**"
1215

1316
concurrency:
14-
group: develop-forms_pro-${{ github.event.number }}
17+
group: version-16-forms_pro-${{ github.event.number }}
1518
cancel-in-progress: true
1619

1720
jobs:
@@ -31,7 +34,7 @@ jobs:
3134
ports:
3235
- 11000:6379
3336
mariadb:
34-
image: mariadb:10.6
37+
image: mariadb:11.8
3538
env:
3639
MYSQL_ROOT_PASSWORD: root
3740
ports:
@@ -87,7 +90,7 @@ jobs:
8790
- name: Setup
8891
run: |
8992
pip install frappe-bench
90-
bench init --skip-redis-config-generation --skip-assets --python "$(which python)" ~/frappe-bench
93+
bench init ~/frappe-bench --version version-16 --skip-redis-config-generation --skip-assets --python "$(which python)"
9194
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
9295
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
9396
@@ -102,6 +105,13 @@ jobs:
102105
env:
103106
CI: "Yes"
104107

108+
- name: Log Frappe version
109+
working-directory: /home/runner/frappe-bench
110+
run: |
111+
FRAPPE_VERSION=$(./env/bin/python -c "import frappe; print(frappe.__version__)" 2>/dev/null || echo "unknown")
112+
echo "Installed Frappe version: $FRAPPE_VERSION"
113+
echo "FRAPPE_VERSION=$FRAPPE_VERSION" >> $GITHUB_ENV
114+
105115
- name: Run Tests
106116
working-directory: /home/runner/frappe-bench
107117
run: |
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
update-version:
11+
name: Set __version__ to Frappe version-16
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Get current Frappe version (version-16 branch)
20+
id: frappe-version
21+
run: |
22+
VERSION=$(curl -sSf "https://raw.githubusercontent.com/frappe/frappe/version-16/frappe/__init__.py" | grep -E '^__version__\s*=' | sed -E "s/__version__\s*=\s*['\"]([^'\"]+)['\"].*/\1/")
23+
if [ -z "$VERSION" ]; then
24+
echo "Could not determine Frappe version from version-16 branch"
25+
exit 1
26+
fi
27+
echo "version=$VERSION" >> $GITHUB_OUTPUT
28+
echo "Frappe version (version-16): $VERSION"
29+
30+
- name: Update __version__ in forms_pro
31+
run: |
32+
FILE="forms_pro/__init__.py"
33+
if [ ! -f "$FILE" ]; then
34+
FILE="apps/forms_pro/forms_pro/__init__.py"
35+
fi
36+
if [ ! -f "$FILE" ]; then
37+
echo "Could not find __init__.py (tried forms_pro/__init__.py and apps/forms_pro/forms_pro/__init__.py)"
38+
exit 1
39+
fi
40+
VERSION="${{ steps.frappe-version.outputs.version }}"
41+
sed -i.bak -E "s/^__version__\s*=\s*['\"][^'\"]*['\"]/__version__ = \"$VERSION\"/" "$FILE" && rm -f "${FILE}.bak"
42+
echo "Updated $FILE to __version__ = \"$VERSION\""
43+
cat "$FILE"
44+
45+
- name: Commit and push
46+
run: |
47+
FILE="forms_pro/__init__.py"
48+
[ -f "$FILE" ] || FILE="apps/forms_pro/forms_pro/__init__.py"
49+
git config user.name "github-actions[bot]"
50+
git config user.email "github-actions[bot]@users.noreply.github.com"
51+
git add "$FILE"
52+
if git diff --staged --quiet; then
53+
echo "No change: __version__ already set to ${{ steps.frappe-version.outputs.version }}"
54+
exit 0
55+
fi
56+
git commit -m "chore: set __version__ to Frappe version-16 (${{ steps.frappe-version.outputs.version }})"
57+
git push

.github/workflows/linter.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: Linters
22

3+
# Frappe version-16 deployment branch: Python 3.14
34
on:
45
pull_request:
6+
branches:
7+
- version-16
58
paths-ignore:
69
- ".github/**"
710
workflow_dispatch:
@@ -23,7 +26,7 @@ jobs:
2326
- uses: actions/checkout@v4
2427
- uses: actions/setup-python@v5
2528
with:
26-
python-version: '3.10'
29+
python-version: '3.14'
2730
cache: pip
2831
- uses: pre-commit/action@v3.0.0
2932

@@ -42,7 +45,7 @@ jobs:
4245
steps:
4346
- uses: actions/setup-python@v5
4447
with:
45-
python-version: '3.10'
48+
python-version: '3.14'
4649

4750
- uses: actions/checkout@v4
4851

.github/workflows/typecheck.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
name: Frontend TypeScript
22

3+
# Frappe version-16 deployment branch: Node 24
34
on:
45
push:
56
branches:
6-
- develop
7+
- version-16
78
paths:
89
- "frontend/**"
910
- ".github/workflows/typecheck.yml"
1011
pull_request:
12+
branches:
13+
- version-16
1114
paths:
1215
- "frontend/**"
1316
- ".github/workflows/typecheck.yml"
1417

1518
concurrency:
16-
group: typecheck-forms_pro-${{ github.event.number || github.sha }}
19+
group: typecheck-version-16-forms_pro-${{ github.event.number || github.sha }}
1720
cancel-in-progress: true
1821

1922
jobs:

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Repository = "https://github.com/buildwithhussain/forms_pro"
2222
requires = ["flit_core >=3.4,<4"]
2323
build-backend = "flit_core.buildapi"
2424

25+
# Required Frappe version; bench uses this for get-app/install validation (version-16 deployment).
26+
# NPM-style bounded range only (no ^, ~, or single-sided constraints).
27+
[tool.bench.frappe-dependencies]
28+
frappe = ">=16.0.0-dev,<17.0.0-dev"
29+
2530
# These dependencies are only installed when developer mode is enabled
2631
[tool.bench.dev-dependencies]
2732
# package_name = "~=1.1.0"

0 commit comments

Comments
 (0)