From d70766476eb367a2393825485ec87a5aeeb8b0e2 Mon Sep 17 00:00:00 2001 From: Ray Bell Date: Mon, 3 May 2021 23:26:01 -0400 Subject: [PATCH 1/2] Create python-publish.yml --- .github/workflows/python-publish.yml | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 00000000..3bc55595 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,46 @@ +name: Upload Python Package + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v0.0.x, + +jobs: + release: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + Changes in this Release + draft: false + prerelease: false + deploy: + needs: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* From ebab44b04f57c337c1b4c32a6015753c712a8c04 Mon Sep 17 00:00:00 2001 From: Ray Bell Date: Mon, 3 May 2021 23:30:53 -0400 Subject: [PATCH 2/2] Update HOWTORELEASE.rst --- HOWTORELEASE.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HOWTORELEASE.rst b/HOWTORELEASE.rst index c3048c6a..76ce0660 100644 --- a/HOWTORELEASE.rst +++ b/HOWTORELEASE.rst @@ -17,7 +17,8 @@ Release Procedure $ git tag -a v0.0.xx -m "Version 0.0.xx" $ git push origin main --tags -#. Build and publish release on PyPI:: +#. Build and publish release on PyPI using the GitHub action. + Otherwise you can manually do it with the following: $ git clean -xfd # remove any files not checked into git $ python setup.py sdist bdist_wheel --universal # build package