From 9f18dbfa8abcda63e6d272bf119aa1582f9348ca Mon Sep 17 00:00:00 2001 From: c-bata Date: Sat, 24 Oct 2020 22:10:57 +0900 Subject: [PATCH] Update action for GitHub releases --- .github/workflows/pypi-publish.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 29b1bfc2..9cf729e4 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -1,9 +1,9 @@ name: Publish distributions to TestPyPI and PyPI on: - release: - types: - - published + create: + tags: + - v*.*.* jobs: build-n-publish: @@ -32,20 +32,19 @@ jobs: - name: Verify the distributions run: twine check dist/* - - uses: actions/upload-artifact@v2 - with: - name: distribution - path: dist/ - - - name: Publish distribution to Test PyPI - uses: pypa/gh-action-pypi-publish@v1.4.1 - with: - user: __token__ - password: ${{ secrets.TEST_PYPI_PASSWORD }} - repository_url: https://test.pypi.org/legacy/ + - name: Install ghr + run: | + wget https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz + tar -xzf ghr_v*_linux_amd64.tar.gz + - name: Create GitHub release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + export TAGNAME=$(jq --raw-output .ref "$GITHUB_EVENT_PATH") + ./ghr_v0.13.0_linux_amd64/ghr -n ${TAGNAME} -b ${TAGNAME} -draft ${TAGNAME} dist/ - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@v1.4.1 with: user: __token__ - password: ${{ secrets.PYPI_PASSWORD }} \ No newline at end of file + password: ${{ secrets.PYPI_PASSWORD }}