From 637bfb3bb5d9c10405880c1495cfed14c5a691e2 Mon Sep 17 00:00:00 2001 From: Bradley Lowekamp Date: Fri, 28 Apr 2023 16:44:05 -0400 Subject: [PATCH] Create Github release on tag --- .github/workflows/main.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe11572..cbf93b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,7 +55,7 @@ jobs: python -m pytest - pypi-publish: + publish: needs: test name: Upload release to PyPI runs-on: ubuntu-latest @@ -81,9 +81,18 @@ jobs: with: name: python-packages path: dist + - name: Create Release and Upload + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + id: create_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --verify-tag --generate-notes --title "Release ${{ github.ref_name }}" + gh release upload ${{ github.ref_name }} --repo ${{ github.repository }} ${{ steps.download.outputs.download-path }}/tomojs_pytools* + - - name: Publish package - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + - name: PyPI Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # hash for release/v1.8 uses: pypa/gh-action-pypi-publish@0bf742be3ebe032c25dd15117957dc15d0cfc38d with: