Repository: planetarypy/pvl (language: python)

Issue:
publish-to-test-pypi.yml runs too much?
Well, I had a fun dive into GitHub actions over the holidays.  I am of the opinion that publish-to-test-pypi.yml runs too often, and checks too late.

So it runs when:
```
on:
  push:
    branches: [ $default-branch ]
```
So every push to the default branch (currently main).  That's as of my new PR, it used to run on every push to any branch.  Even so, there can be pushes to the main branch that don't need to trigger a build upload to PyPI.

That's currently handled by this if in the last step:
```
    - name: Publish distribution to PyPI
      if: startsWith(github.ref, 'refs/tags')
```

So for every push, it is going to do a pip install, and build a distribution, but then only push if there is a tag.  Again, any tag.  Not just version update tags, but any tags.  Now, at the moment, those *are* the only tags in the repo, but there could be others, and this might do weird things.

It seems to me that we should refine the `on` statement, so it only runs this workflow if it gets a version tag.  I *think* that can be done like this:
```
on:
  push:
    branches: [ $default-branch ]
    tags: 'v*'
```
assuming we stay vigilant and keep using the "v*" tag pattern.

Integrate and Harmonize Workflow scripts
Need to step back and thoughtfully combine the publish-to-test-pypi.yml GitHub workflow and the python-test.yml workflow into something more coherent.  Working this Issue would close #77.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml
new file mode 100644
index 0000000..382b0b2
--- /dev/null
+++ b/.github/workflows/publish-to-pypi.yml
@@ -0,0 +1,34 @@
+name: Publish Python distributions to PyPI
+
+on:
+  release:
+    types: [created]
+
+jobs:
+  deploy:
+    name: Build and publish Python distributions to PyPI
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python
+      uses: actions/setup-python@v2
+      with:
+        python-version: 3.6
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install setuptools wheel twine
+    - name: Build a binary wheel and a source tarball
+      run: |
+        python setup.py sdist bdist_wheel
+    - name: Publish distribution to Test PyPI
+      uses: pypa/gh-action-pypi-publish@release/v1
+      with:
+        user: __token__
+        password: ${{ secrets.TEST_PYPI_API_TOKEN }}
+        repository_url: https://test.pypi.org/legacy/
+    # - name: Publish distribution to PyPI
+    #   uses: pypa/gh-action-pypi-publish@release/v1
+    #   with:
+    #     user: __token__
+    #     password: ${{ secrets.PYPI_API_TOKEN }}


Test patch:
diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml
deleted file mode 100644
index 4f53675..0000000
--- a/.github/workflows/publish-to-test-pypi.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-name: Publish Python distributions to PyPI and TestPyPI
-
-on:
-  push:
-    branches: [ $default-branch ]
-
-jobs:
-  build-n-publish:
-    name: Build and publish Python distributions to PyPI and TestPyPI
-    runs-on: ubuntu-latest
-    steps:
-    - uses: actions/checkout@master
-    - name: Set up Python 3.7
-      uses: actions/setup-python@v1
-      with:
-        python-version: 3.7
-    - name: Install pypa/build
-      run: >-
-        python -m
-        pip install
-        build
-        --user
-    - name: Build a binary wheel and a source tarball
-      run: >-
-        python -m
-        build
-        --sdist
-        --wheel
-        --outdir dist/
-        .
-    - name: Publish distribution to Test PyPI
-      uses: pypa/gh-action-pypi-publish@f91f98d65eb3eb032447201d64f2c25d67c28efe
-      with:
-        user: __token__
-        password: ${{ secrets.TEST_PYPI_API_TOKEN }}
-        repository_url: https://test.pypi.org/legacy/
-    - name: Publish distribution to PyPI
-      if: startsWith(github.ref, 'refs/tags')
-      uses: pypa/gh-action-pypi-publish@master
-      with:
-        user: __token__
-        password: ${{ secrets.PYPI_API_TOKEN }}