diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 00000000..80e2ad24 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,20 @@ +[bumpversion] +current_version = 1.9.0 +commit = True +tag = True +parse = (?P\d+)(\.(?P\d+))(\.(?P\d+))((?P.)(?P\d+))? +serialize = + {major}.{minor}.{patch}{release}{build} + {major}.{minor}.{patch} + +[bumpversion:part:release] +optional_value = g +first_value = g +values = + a + b + g + +[bumpversion:file:ipyvue/_version.py] + +[bumpversion:file:js/package.json] diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..456a661c --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,41 @@ +name: Publish Package + +on: + push: + tags: + - "*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install node + uses: actions/setup-node@v1 + with: + node-version: "14.x" + registry-url: "https://registry.npmjs.org" + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install twine wheel jupyter-packaging jupyterlab + - name: Publish the Python package + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload --skip-existing dist/* + - name: Publish the NPM package + run: | + cd js + echo $PRE_RELEASE + if [[ $PRE_RELEASE == "true" ]]; then export TAG="next"; else export TAG="latest"; fi + npm publish --tag ${TAG} --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + PRE_RELEASE: ${{ github.event.release.prerelease }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..0eead26b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: Build + +on: + - push + - pull_request + - workflow_dispatch + +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"] + + steps: + - uses: actions/checkout@v2 + - name: Install node + uses: actions/setup-node@v1 + with: + node-version: "14.x" + registry-url: "https://registry.npmjs.org" + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install twine wheel jupyter-packaging jupyterlab + - name: Build + run: | + python setup.py bdist_wheel + - name: Install + run: pip install dist/*.whl + - name: Import + run: python -c "from ipyvuetify import Btn" diff --git a/ipyvuetify/__init__.py b/ipyvuetify/__init__.py index 28aaad3e..c044e3c2 100755 --- a/ipyvuetify/__init__.py +++ b/ipyvuetify/__init__.py @@ -1,4 +1,4 @@ -from ._version import __version__, version_info # noqa: F401 +from ._version import __version__ # noqa: F401 from .generated import * # noqa: F401, F403 from .Html import Html # noqa: F401 from .Themes import theme # noqa: F401 diff --git a/ipyvuetify/_version.py b/ipyvuetify/_version.py index efe793ab..9c8ccf38 100644 --- a/ipyvuetify/_version.py +++ b/ipyvuetify/_version.py @@ -1,14 +1,2 @@ -version_info = (1, 8, 5, "final") - -_specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": ""} - -__version__ = "%s.%s.%s%s" % ( - version_info[0], - version_info[1], - version_info[2], - "" - if version_info[3] == "final" - else _specifier_[version_info[3]] + str(version_info[4]), -) - +__version__ = "1.8.5" semver = "^" + __version__ diff --git a/release.sh b/release.sh new file mode 100755 index 00000000..0f104ed0 --- /dev/null +++ b/release.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e -o pipefail +# usage: ./release minor -n +version=$(bump2version --dry-run --list $* | grep new_version | sed -r s,"^.*=",,) +echo Version tag v$version +bumpversion $* --verbose && git push upstream master v$version