From 9b0a12fc2ee5a4d4cdaf0c07e056c4b011ad3964 Mon Sep 17 00:00:00 2001 From: Han Wang Date: Thu, 17 Dec 2020 21:50:38 +0000 Subject: [PATCH] setup2 --- .github/workflows/publish.yml | 14 ++++++++++++-- setup.py | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 41f0c81..69278cc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,9 +8,8 @@ on: types: [created] jobs: - deploy: + install: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - name: Set up Python 3.7 @@ -19,6 +18,12 @@ jobs: python-version: 3.7 - name: Install dependencies run: make dev + + coverage: + runs-on: ubuntu-latest + if: "!github.event.release.prerelease" + needs: install + steps: - name: Test run: make test - name: Coveralls @@ -27,6 +32,11 @@ jobs: run: | pip install coveralls coveralls + + publish: + runs-on: ubuntu-latest + needs: install + steps: - name: Build and publish env: RELEASE_TAG: ${{ github.event.release.tag_name }} diff --git a/setup.py b/setup.py index 898c7d1..92ced4f 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,8 @@ def get_version() -> str: tag = os.environ.get("RELEASE_TAG", "") if "dev" in tag.split(".")[-1]: return tag + if tag != "": + assert tag == __version__, "release tag and version mismatch" return __version__