|
@@ -12,11 +12,11 @@ on:
|
|
|
description: "The taipy-templates version to use (ex: 2.3.0.dev0)"
|
|
|
|
|
|
jobs:
|
|
|
- release-dev-package:
|
|
|
+ release-dev-package-v2:
|
|
|
timeout-minutes: 20
|
|
|
runs-on: ubuntu-latest
|
|
|
steps:
|
|
|
- - uses: actions/checkout@v3
|
|
|
+ - uses: actions/checkout@v4
|
|
|
with:
|
|
|
ssh-key: ${{secrets.DEPLOY_KEY}}
|
|
|
- uses: actions/setup-python@v4
|
|
@@ -26,46 +26,24 @@ jobs:
|
|
|
with:
|
|
|
node-version: '20'
|
|
|
|
|
|
- - name: Ensure package version has 'dev' suffix
|
|
|
+ - name: Setup Dev Version
|
|
|
+ id: version-setup
|
|
|
run: |
|
|
|
- echo """
|
|
|
- import json, sys, os
|
|
|
- SUFFIX = 'dev'
|
|
|
- with open(f\"taipy{os.sep}version.json\") as version_file:
|
|
|
- version_o = json.load(version_file)
|
|
|
- version = f'{version_o.get(\"major\")}.{version_o.get(\"minor\")}.{version_o.get(\"patch\")}'
|
|
|
- if vext := version_o.get(\"ext\"):
|
|
|
- version = f'{version}.{vext}'
|
|
|
- if SUFFIX not in version:
|
|
|
- raise ValueError(f\"version {version} does not contain suffix {SUFFIX}\")
|
|
|
- """ > ${{ runner.temp }}/check1.py
|
|
|
- python ${{ runner.temp }}/check1.py
|
|
|
+ python tools/release/setup_version.py taipy dev >> $GITHUB_OUTPUT
|
|
|
|
|
|
- - name: Extract package version
|
|
|
- id: current-version
|
|
|
- run: |
|
|
|
- echo """
|
|
|
- import json, os
|
|
|
- with open(f\"taipy{os.sep}version.json\") as version_file:
|
|
|
- version_o = json.load(version_file)
|
|
|
- version = f'{version_o.get(\"major\")}.{version_o.get(\"minor\")}.{version_o.get(\"patch\")}'
|
|
|
- if vext := version_o.get(\"ext\"):
|
|
|
- version = f'{version}.{vext}'
|
|
|
- print(f'VERSION={version}')
|
|
|
- """ > ${{ runner.temp }}/check2.py
|
|
|
- python ${{ runner.temp }}/check2.py >> $GITHUB_OUTPUT
|
|
|
-
|
|
|
- - name: Check taipy-gui dependencies
|
|
|
+ - name: Check Taipy Gui version is available
|
|
|
run: |
|
|
|
curl https://pypi.org/simple/taipy-gui/ | grep -o ">taipy-gui-${{ github.event.inputs.taipy-gui-version }}\.tar\.gz<"
|
|
|
-
|
|
|
- name: Install dependencies
|
|
|
run: |
|
|
|
python -m pip install --upgrade pip
|
|
|
pip install build wheel
|
|
|
+
|
|
|
+ - name: Install Taipy Gui
|
|
|
+ run: |
|
|
|
pip install "taipy-gui==${{ github.event.inputs.taipy-gui-version }}"
|
|
|
|
|
|
- - name: Check dependencies are available
|
|
|
+ - name: Check Taipy Rest and Taipy Templates are available
|
|
|
if: github.event.inputs.taipy-rest-version != '' && github.event.inputs.taipy-templates-version != ''
|
|
|
run: |
|
|
|
curl https://pypi.org/simple/taipy-rest/ | grep -o ">taipy-rest-${{ github.event.inputs.taipy-rest-version }}\.tar\.gz<"
|
|
@@ -75,57 +53,20 @@ jobs:
|
|
|
if: github.event.inputs.taipy-gui-version != '' && github.event.inputs.taipy-rest-version != '' && github.event.inputs.taipy-templates-version != ''
|
|
|
run: |
|
|
|
mv setup.py setup.taipy.py
|
|
|
- echo """
|
|
|
- import sys
|
|
|
- with open('setup.taipy.py', mode='r') as setup_r, open('setup.py', mode='w') as setup_w:
|
|
|
- in_requirements = False
|
|
|
- looking = True
|
|
|
- for line in setup_r:
|
|
|
- if looking:
|
|
|
- if line.lstrip().startswith('requirements') and line.rstrip().endswith('['):
|
|
|
- in_requirements = True
|
|
|
- elif in_requirements:
|
|
|
- if line.strip() == ']':
|
|
|
- looking = False
|
|
|
- else:
|
|
|
- if line.lstrip().startswith('\"taipy-gui@git+https'):
|
|
|
- start = line.find('\"taipy-gui')
|
|
|
- end = line.rstrip().find(',')
|
|
|
- line = f'{line[:start]}\"taipy-gui=={sys.argv[1]}\"{line[end:]}'
|
|
|
- elif line.lstrip().startswith('\"taipy-rest@git+https'):
|
|
|
- start = line.find('\"taipy-rest')
|
|
|
- end = line.rstrip().find(',')
|
|
|
- line = f'{line[:start]}\"taipy-rest=={sys.argv[2]}\"{line[end:]}'
|
|
|
- elif line.lstrip().startswith('\"taipy-templates@git+https'):
|
|
|
- start = line.find('\"taipy-templates')
|
|
|
- end = line.rstrip().find(',')
|
|
|
- line = f'{line[:start]}\"taipy-templates=={sys.argv[3]}\"{line[end:]}'
|
|
|
- setup_w.write(line)
|
|
|
- """ > ${{ runner.temp }}/write_setup_taipy.py
|
|
|
- python ${{ runner.temp }}/write_setup_taipy.py "${{ github.event.inputs.taipy-gui-version }}" "${{ github.event.inputs.taipy-rest-version }}" "${{ github.event.inputs.taipy-templates-version }}"
|
|
|
+ python tools/release/update_setup.py "${{ github.event.inputs.taipy-gui-version }}" "${{ github.event.inputs.taipy-rest-version }}" "${{ github.event.inputs.taipy-templates-version }}"
|
|
|
|
|
|
- - name: Build package
|
|
|
+ - name: Build Taipy package
|
|
|
run: python setup.py build_py && python -m build
|
|
|
|
|
|
- - name: Install the package and test it
|
|
|
+ - name: Install the Taipy package and test it
|
|
|
run: |
|
|
|
# Install package
|
|
|
echo "Installing package..."
|
|
|
- pip install ./dist/${{ github.event.repository.name }}-${{ steps.current-version.outputs.VERSION }}.tar.gz
|
|
|
+ pip install ./dist/${{ github.event.repository.name }}-${{ steps.version-setup.outputs.VERSION }}.tar.gz
|
|
|
|
|
|
- # Run tests
|
|
|
- python -c "import taipy as tp; tp.Scenario"
|
|
|
- python -c "import taipy as tp; tp.gui"
|
|
|
- python -c "import taipy as tp; tp.rest"
|
|
|
-
|
|
|
- echo """
|
|
|
- import taipy
|
|
|
- from pathlib import Path
|
|
|
- taipy_gui_core_path = Path(taipy.__file__).absolute().parent / 'gui_core' / 'lib' / 'taipy-gui-core.js'
|
|
|
- if not taipy_gui_core_path.exists():
|
|
|
- raise FileNotFoundError(f'taipy-gui-core.js not found in {taipy_gui_core_path}')
|
|
|
- """ > ${{ runner.temp }}/verify_gui_core.py
|
|
|
- python ${{ runner.temp }}/verify_gui_core.py
|
|
|
+ - name: Check Taipy Installation
|
|
|
+ run: |
|
|
|
+ python tools/validate_taipy_install.py
|
|
|
|
|
|
- name: Extract commit hash
|
|
|
shell: bash
|
|
@@ -135,7 +76,7 @@ jobs:
|
|
|
- name: Create/update release and tag
|
|
|
run: |
|
|
|
echo "Creating release ${{ steps.current-version.outputs.VERSION }}"
|
|
|
- gh release create ${{ steps.current-version.outputs.VERSION }} ./dist/${{ github.event.repository.name }}-${{ steps.current-version.outputs.VERSION }}.tar.gz --target ${{ steps.extract_hash.outputs.HASH }} --prerelease --title ${{ steps.current-version.outputs.VERSION }} --notes "Release Draft ${{ steps.current-version.outputs.VERSION }}"
|
|
|
+ gh release create ${{ steps.version-setup.outputs.VERSION }} ./dist/${{ github.event.repository.name }}-${{ steps.version-setup.outputs.VERSION }}.tar.gz --target ${{ steps.extract_hash.outputs.HASH }} --prerelease --title ${{ steps.version-setup.outputs.VERSION }} --notes "Release Draft ${{ steps.version-setup.outputs.VERSION }}"
|
|
|
env:
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
@@ -144,30 +85,6 @@ jobs:
|
|
|
git reset --hard HEAD
|
|
|
git clean -fdx
|
|
|
|
|
|
- - name: Increase dev version
|
|
|
- id: new-version
|
|
|
- run: |
|
|
|
- echo """
|
|
|
- import json, os
|
|
|
- with open(f'taipy{os.sep}version.json') as version_file:
|
|
|
- version_o = json.load(version_file)
|
|
|
- if version_o is None or 'dev' not in version_o['ext']:
|
|
|
- raise ValueError('Invalid version file. Version must contain dev suffix.')
|
|
|
- prev_version = version_o['ext']
|
|
|
- new_version = 'dev' + str(int(version_o['ext'].replace('dev', '')) + 1)
|
|
|
- with open(f'taipy{os.sep}version.json') as r:
|
|
|
- text = r.read().replace(prev_version, new_version)
|
|
|
- with open(f'taipy{os.sep}version.json', mode='w') as w:
|
|
|
- w.write(text)
|
|
|
- with open(f\"taipy{os.sep}version.json\") as version_file:
|
|
|
- version_o = json.load(version_file)
|
|
|
- version = f'{version_o.get(\"major\")}.{version_o.get(\"minor\")}.{version_o.get(\"patch\")}'
|
|
|
- if vext := version_o.get(\"ext\"):
|
|
|
- version = f'{version}.{vext}'
|
|
|
- print(f'VERSION={version}')
|
|
|
- """ > ${{ runner.temp }}/increase_dev_version.py
|
|
|
- python ${{ runner.temp }}/increase_dev_version.py >> $GITHUB_OUTPUT
|
|
|
-
|
|
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
|
|
with:
|
|
|
- commit_message: Update version to ${{ steps.new-version.outputs.VERSION }}
|
|
|
+ commit_message: Update version to ${{ steps.version-setup.outputs.NEW_VERSION }}
|