|
@@ -0,0 +1,61 @@
|
|
|
+name: Publish pre-release to github
|
|
|
+
|
|
|
+on:
|
|
|
+ workflow_dispatch:
|
|
|
+ inputs:
|
|
|
+ version:
|
|
|
+ description: "The package version to create (ex: 1.0.0)"
|
|
|
+ required: true
|
|
|
+
|
|
|
+jobs:
|
|
|
+ check-package-version:
|
|
|
+ timeout-minutes: 20
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - uses: actions/setup-python@v4
|
|
|
+ with:
|
|
|
+ python-version: 3.8
|
|
|
+
|
|
|
+ - name: Ensure package version is properly set
|
|
|
+ run: |
|
|
|
+ echo """
|
|
|
+ import json, sys, 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}'
|
|
|
+ if version != sys.argv[1]:
|
|
|
+ raise ValueError(f\"Invalid version {version} / {sys.argv[1]}\")
|
|
|
+ """ > /tmp/check1.py
|
|
|
+ python /tmp/check1.py "${{ github.event.inputs.version }}"
|
|
|
+
|
|
|
+ publish:
|
|
|
+ needs: [check-package-version]
|
|
|
+ timeout-minutes: 20
|
|
|
+ environment: publish
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - uses: actions/setup-python@v4
|
|
|
+ with:
|
|
|
+ python-version: 3.8
|
|
|
+ - uses: actions/setup-node@v3
|
|
|
+ with:
|
|
|
+ node-version: '18'
|
|
|
+
|
|
|
+ - name: Install dependencies
|
|
|
+ run: |
|
|
|
+ python -m pip install --upgrade pip
|
|
|
+ pip install build
|
|
|
+
|
|
|
+ - name: Build package
|
|
|
+ run: python setup.py build_py && python -m build
|
|
|
+
|
|
|
+ - name: Create/update release and tag
|
|
|
+ run: |
|
|
|
+ gh release delete dev-${{ github.event.inputs.version }} -y || true
|
|
|
+ gh release create dev-${{ github.event.inputs.version }} ./dist/taipy-${{ github.event.inputs.version }}.tar.gz --draft --prerelease --notes "Release Draft ${{ github.event.inputs.version }}"
|
|
|
+ env:
|
|
|
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|