From bfcc199de8ca13fe4cf866e9ae74cbd125316fe7 Mon Sep 17 00:00:00 2001 From: Ed Rivas Date: Tue, 8 Sep 2020 19:31:19 -0600 Subject: [PATCH] ci: configure semantic-release --- .github/workflows/main.yml | 44 ++++++++++++++++++++++++++++++++++++++ .releaserc | 19 ++++++++++++++++ .travis.yml | 24 --------------------- MANIFEST.in | 1 + mezzanine/__init__.py | 2 +- 5 files changed, 65 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 .releaserc delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..f3a736957b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,44 @@ +name: Test and release + +# Fires on all incoming commits +on: [push] + +jobs: + + # Test + test: + runs-on: ubuntu-latest + strategy: + matrix: + python: [3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: pip install tox tox-gh-actions + - name: Run tests + run: tox --parallel + env: + TOX_PARALLEL_NO_SPINNER: 1 + + # Create a new semantic release + release: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + with: + python-version: 3.8 + - uses: cycjimmy/semantic-release-action@v2 + with: + semantic_version: 17 + extra_plugins: | + @semantic-release/exec@5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000000..96a7bfc7fa --- /dev/null +++ b/.releaserc @@ -0,0 +1,19 @@ +{ + "branches": [ + "+([0-9])?(.{+([0-9]),x}).x", + "stable", + {"name": "alpha", "prerelease": true}, + {"name": "beta", "prerelease": true}, + {"name": "rc", "prerelease": true} + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/github", + ["@semantic-release/exec", { + "verifyConditionsCmd": "python -m pip install -U pip setuptools wheel twine", + "prepareCmd": "sed -i 's/0.0.dev0/${nextRelease.version}/' mezzanine/__init__.py", + "publishCmd": "python setup.py sdist bdist_wheel && twine upload dist/*" + }] + ] +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d30204e36b..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: python -env: - - DJANGO="22" - - DJANGO="master" -python: - - "3.5" - - "3.6" - - "3.7" - - "3.8" -install: - - pip install --upgrade pip setuptools tox -script: - - tox -e py$(python -c 'import sys;print("".join(map(str, sys.version_info[:2])))')-dj${DJANGO} -matrix: - fast_finish: true - include: - - python: "3.5" - env: DJANGO="22" - allow_failures: - - env: DJANGO="master" -notifications: - irc: "irc.freenode.org#mezzanine" - on_success: change - on_failure: change diff --git a/MANIFEST.in b/MANIFEST.in index f718bbc398..6a7741e520 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,3 +7,4 @@ global-exclude __pycache__ global-exclude *.py[co] prune .tx prune tests +exclude .releaserc diff --git a/mezzanine/__init__.py b/mezzanine/__init__.py index ed48cdab09..51539633fb 100644 --- a/mezzanine/__init__.py +++ b/mezzanine/__init__.py @@ -1 +1 @@ -__version__ = "4.3.1" +__version__ = "0.0.dev0" # Do not edit, managed by semantic-release