diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5570e04 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ + +name: Release + +on: + push: + tags: + - '*.*.*' + +jobs: + + ######################## + # RELEASE CREATION JOB # + ######################## + job_release: + name: Create Release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + tag: ${{ steps.tag.outputs.tag }} + steps: + - name: Get tag + id: tag + run: | + echo ::set-output name=tag::${GITHUB_REF#refs/tags/} + - uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.tag.outputs.tag }} + release_name: vpype ${{ steps.tag.outputs.tag }} + draft: true + prerelease: false + + + ################## + # UPLOAD TO PYPI # + ################## + job_pypi: + name: Upload to PyPI + runs-on: ubuntu-latest + needs: job_release + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Build + id: build + run: | + pip install -r dev-requirements.txt + pip install . + python setup.py sdist bdist_wheel + echo ::set-output name=version::`python -c "import vnoise;print(vnoise.__version__)"` + - name: Upload File Assets + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.job_release.outputs.upload_url }} + asset_path: dist/vnoise-${{ steps.build.outputs.version }}.tar.gz + asset_name: vnoise-${{ steps.build.outputs.version }}.tar.gz + asset_content_type: application/gzip + - name: pypi-publish + uses: pypa/gh-action-pypi-publish@v1.4.1 + with: + # repository_url: https://test.pypi.org/legacy/ + password: ${{ secrets.PYPI_TOKEN }} + # skip_existing: true + verbose: true diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..75b4b79 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Change log + +#### 0.1.0 (2021-02-24) + +* Initial release \ No newline at end of file diff --git a/dev-requirements.txt b/dev-requirements.txt index bb03249..8917883 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,6 @@ black isort mypy -pytest \ No newline at end of file +pytest +setuptools +wheel \ No newline at end of file diff --git a/setup.py b/setup.py index 9dab78f..2bb7ffe 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,9 @@ -from setuptools import setup +import pathlib -with open("README.md") as f: - readme = f.read() +from setuptools import setup -with open("LICENSE") as f: - license_file = f.read() +HERE = pathlib.Path(__file__).parent +readme = (HERE / "README.md").read_text() setup( name="vnoise", @@ -13,13 +12,20 @@ long_description=readme, long_description_content_type="text/markdown", author="Antoine Beyeler", - email="abeyeler@ab-ware.com", - url="https://github.com/vpype/vnoise", - license=license_file, + author_email="abeyeler@ab-ware.com", + url="https://github.com/plottertools/vnoise", + license="MIT", packages=["vnoise"], python_requires=">=3.6", install_requires=[ "numpy>=1.19", "setuptools", ], + classifiers=[ + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Multimedia :: Graphics", + "Typing :: Typed", + ], )