From 96b240c20fb15d33520c1229b25fe9b47336ae12 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 24 Feb 2021 22:47:11 +0100 Subject: [PATCH 1/4] Prepping for release --- .github/workflows/release.yml | 73 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 5 +++ dev-requirements.txt | 4 +- setup.py | 11 +++++- 4 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..86c5842 --- /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-requirement.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.TEST_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..2bf4864 100644 --- a/setup.py +++ b/setup.py @@ -13,8 +13,8 @@ long_description=readme, long_description_content_type="text/markdown", author="Antoine Beyeler", - email="abeyeler@ab-ware.com", - url="https://github.com/vpype/vnoise", + author_email="abeyeler@ab-ware.com", + url="https://github.com/plottertools/vnoise", license=license_file, packages=["vnoise"], python_requires=">=3.6", @@ -22,4 +22,11 @@ "numpy>=1.19", "setuptools", ], + classifiers=[ + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Multimedia :: Graphics", + "Typing :: Typed", + ], ) From 7640ade4c6a3639326ff00e09aee5a799b124133 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 24 Feb 2021 22:51:16 +0100 Subject: [PATCH 2/4] Fixed type --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86c5842..e5d0109 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: - name: Build id: build run: | - pip install -r dev-requirement.txt + 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__)"` From a96e7bb3f069aeab661562eadf5b5718e5807c53 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 24 Feb 2021 23:01:08 +0100 Subject: [PATCH 3/4] Fixed setup.py --- setup.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 2bf4864..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", @@ -15,7 +14,7 @@ author="Antoine Beyeler", author_email="abeyeler@ab-ware.com", url="https://github.com/plottertools/vnoise", - license=license_file, + license="MIT", packages=["vnoise"], python_requires=">=3.6", install_requires=[ From 3b951ea111eaeb68fd1bd9f2a42ae7876148f4eb Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 24 Feb 2021 23:16:47 +0100 Subject: [PATCH 4/4] Switched to prod PYPI --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5d0109..5570e04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,7 +67,7 @@ jobs: - name: pypi-publish uses: pypa/gh-action-pypi-publish@v1.4.1 with: - repository_url: https://test.pypi.org/legacy/ - password: ${{ secrets.TEST_PYPI_TOKEN }} + # repository_url: https://test.pypi.org/legacy/ + password: ${{ secrets.PYPI_TOKEN }} # skip_existing: true verbose: true