|
@@ -1,4 +1,4 @@
|
|
-name: Create Github pre-release
|
|
|
|
|
|
+name: Create Github Dev Release
|
|
|
|
|
|
on:
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_dispatch:
|
|
@@ -8,13 +8,11 @@ on:
|
|
required: true
|
|
required: true
|
|
taipy-rest-version:
|
|
taipy-rest-version:
|
|
description: "The taipy-rest version to use (ex: 2.3.0.dev0)"
|
|
description: "The taipy-rest version to use (ex: 2.3.0.dev0)"
|
|
- required: true
|
|
|
|
taipy-templates-version:
|
|
taipy-templates-version:
|
|
description: "The taipy-templates version to use (ex: 2.3.0.dev0)"
|
|
description: "The taipy-templates version to use (ex: 2.3.0.dev0)"
|
|
- required: true
|
|
|
|
|
|
|
|
jobs:
|
|
jobs:
|
|
- publish:
|
|
|
|
|
|
+ release-dev-package:
|
|
timeout-minutes: 20
|
|
timeout-minutes: 20
|
|
runs-on: ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
steps:
|
|
@@ -28,21 +26,6 @@ jobs:
|
|
with:
|
|
with:
|
|
node-version: '18'
|
|
node-version: '18'
|
|
|
|
|
|
- - name: Extract branch name
|
|
|
|
- shell: bash
|
|
|
|
- run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
|
|
|
|
- id: extract_branch
|
|
|
|
-
|
|
|
|
- - name: Validate branch name (has 'dev' prefix)
|
|
|
|
- run: |
|
|
|
|
- echo """
|
|
|
|
- import sys
|
|
|
|
- PREFIX = 'dev'
|
|
|
|
- if not sys.argv[1].startswith(PREFIX):
|
|
|
|
- raise ValueError(f'Branch name must start with \"{PREFIX}\"')
|
|
|
|
- """ > /tmp/check.py
|
|
|
|
- python /tmp/check.py "${{ steps.extract_branch.outputs.BRANCH }}"
|
|
|
|
-
|
|
|
|
- name: Ensure package version has 'dev' suffix
|
|
- name: Ensure package version has 'dev' suffix
|
|
run: |
|
|
run: |
|
|
echo """
|
|
echo """
|
|
@@ -58,63 +41,68 @@ jobs:
|
|
""" > /tmp/check1.py
|
|
""" > /tmp/check1.py
|
|
python /tmp/check1.py
|
|
python /tmp/check1.py
|
|
|
|
|
|
- - name: Check dependencies are available
|
|
|
|
|
|
+ - name: Extract package version
|
|
|
|
+ id: current-version
|
|
run: |
|
|
run: |
|
|
- curl https://pypi.org/simple/taipy-gui/ | grep -o ">taipy-gui-${{ github.event.inputs.taipy-gui-version }}\.tar\.gz<"
|
|
|
|
- curl https://pypi.org/simple/taipy-rest/ | grep -o ">taipy-rest-${{ github.event.inputs.taipy-rest-version }}\.tar\.gz<"
|
|
|
|
- curl https://pypi.org/simple/taipy-templates/ | grep -o ">taipy-templates-${{ github.event.inputs.taipy-templates-version }}\.tar\.gz<"
|
|
|
|
|
|
+ echo """
|
|
|
|
+ import json, os
|
|
|
|
+ with open(f\"src{os.sep}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}')
|
|
|
|
+ """ > /tmp/check2.py
|
|
|
|
+ python /tmp/check2.py >> $GITHUB_OUTPUT
|
|
|
|
|
|
- - name: Grab the version of the package
|
|
|
|
- id: current-version
|
|
|
|
|
|
+ - name: Check taipy-gui dependencies
|
|
run: |
|
|
run: |
|
|
- echo """
|
|
|
|
- import json, os
|
|
|
|
- with open(f\"src{os.sep}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}')
|
|
|
|
- """ > /tmp/check2.py
|
|
|
|
- python /tmp/check2.py >> $GITHUB_OUTPUT
|
|
|
|
|
|
+ curl https://pypi.org/simple/taipy-gui/ | grep -o ">taipy-gui-${{ github.event.inputs.taipy-gui-version }}\.tar\.gz<"
|
|
|
|
|
|
- name: Install dependencies
|
|
- name: Install dependencies
|
|
run: |
|
|
run: |
|
|
- python -m pip install --upgrade pip
|
|
|
|
- pip install build
|
|
|
|
- pip install "taipy-gui==${{ github.event.inputs.taipy-gui-version }}"
|
|
|
|
|
|
+ python -m pip install --upgrade pip
|
|
|
|
+ pip install build
|
|
|
|
+ pip install "taipy-gui==${{ github.event.inputs.taipy-gui-version }}"
|
|
|
|
|
|
|
|
+ - name: Check dependencies 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<"
|
|
|
|
+ curl https://pypi.org/simple/taipy-templates/ | grep -o ">taipy-templates-${{ github.event.inputs.taipy-templates-version }}\.tar\.gz<"
|
|
|
|
+
|
|
- name: Update setup.py locally
|
|
- name: Update setup.py locally
|
|
|
|
+ if: github.event.inputs.taipy-gui-version != '' && github.event.inputs.taipy-rest-version != '' && github.event.inputs.taipy-templates-version != ''
|
|
run: |
|
|
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)
|
|
|
|
- """ > /tmp/write_setup_taipy.py
|
|
|
|
- python /tmp/write_setup_taipy.py "${{ github.event.inputs.taipy-gui-version }}" "${{ github.event.inputs.taipy-rest-version }}" "${{ github.event.inputs.taipy-templates-version }}"
|
|
|
|
|
|
+ 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)
|
|
|
|
+ """ > /tmp/write_setup_taipy.py
|
|
|
|
+ python /tmp/write_setup_taipy.py "${{ github.event.inputs.taipy-gui-version }}" "${{ github.event.inputs.taipy-rest-version }}" "${{ github.event.inputs.taipy-templates-version }}"
|
|
|
|
|
|
- name: Build package
|
|
- name: Build package
|
|
run: python setup.py build_py && python -m build
|
|
run: python setup.py build_py && python -m build
|
|
@@ -123,7 +111,7 @@ jobs:
|
|
run: |
|
|
run: |
|
|
# Install package
|
|
# Install package
|
|
echo "Installing package..."
|
|
echo "Installing package..."
|
|
- pip install ./dist/taipy-${{ steps.current-version.outputs.VERSION }}.tar.gz
|
|
|
|
|
|
+ pip install ./dist/${{ github.event.repository.name }}-${{ steps.current-version.outputs.VERSION }}.tar.gz
|
|
|
|
|
|
# Run tests
|
|
# Run tests
|
|
python -c "import taipy as tp; tp.Scenario"
|
|
python -c "import taipy as tp; tp.Scenario"
|
|
@@ -137,39 +125,39 @@ jobs:
|
|
|
|
|
|
- name: Create/update release and tag
|
|
- name: Create/update release and tag
|
|
run: |
|
|
run: |
|
|
- echo "Creating release ${{ steps.current-version.outputs.VERSION }}"
|
|
|
|
- gh release create ${{ steps.current-version.outputs.VERSION }} ./dist/taipy-${{ 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 }}"
|
|
|
|
|
|
+ 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 }}"
|
|
env:
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
- name: Reset changes
|
|
- name: Reset changes
|
|
run: |
|
|
run: |
|
|
- git reset --hard HEAD
|
|
|
|
- git clean -fdx
|
|
|
|
|
|
+ git reset --hard HEAD
|
|
|
|
+ git clean -fdx
|
|
|
|
|
|
- name: Increase dev version
|
|
- name: Increase dev version
|
|
id: new-version
|
|
id: new-version
|
|
run: |
|
|
run: |
|
|
- echo """
|
|
|
|
- import json, os
|
|
|
|
- with open(f'src{os.sep}taipy{os.sep}version.json') as version_file:
|
|
|
|
|
|
+ echo """
|
|
|
|
+ import json, os
|
|
|
|
+ with open(f'src{os.sep}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'src{os.sep}taipy{os.sep}version.json') as r:
|
|
|
|
+ text = r.read().replace(prev_version, new_version)
|
|
|
|
+ with open(f'src{os.sep}taipy{os.sep}version.json', mode='w') as w:
|
|
|
|
+ w.write(text)
|
|
|
|
+ with open(f\"src{os.sep}taipy{os.sep}version.json\") as version_file:
|
|
version_o = json.load(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'src{os.sep}taipy{os.sep}version.json') as r:
|
|
|
|
- text = r.read().replace(prev_version, new_version)
|
|
|
|
- with open(f'src{os.sep}taipy{os.sep}version.json', mode='w') as w:
|
|
|
|
- w.write(text)
|
|
|
|
- with open(f\"src{os.sep}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}')
|
|
|
|
- """ > /tmp/increase_dev_version.py
|
|
|
|
- python /tmp/increase_dev_version.py >> $GITHUB_OUTPUT
|
|
|
|
|
|
+ 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}')
|
|
|
|
+ """ > /tmp/increase_dev_version.py
|
|
|
|
+ python /tmp/increase_dev_version.py >> $GITHUB_OUTPUT
|
|
|
|
|
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
with:
|