From d71f299ae64e7986a6f57bfb5f5ccffdb25927df Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 17 Nov 2022 16:06:46 +0900 Subject: [PATCH 1/2] Update deploy script Update deploy script to raise error when failed to release --- tasks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks.py b/tasks.py index bbc0698..ed853a2 100644 --- a/tasks.py +++ b/tasks.py @@ -41,8 +41,10 @@ def release(context: Context) -> None: ''', pty=True, ) - except UnexpectedExit: - pass + except UnexpectedExit as exception: + with open(pyproject_path, 'w', encoding='utf-8') as pyproject_file: + pyproject_file.write(pyproject_string) + raise exception # recover to original with open(pyproject_path, 'w', encoding='utf-8') as pyproject_file: From a3e905974bbd4d860720bdee7261639d4b1a2af3 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 17 Nov 2022 16:07:19 +0900 Subject: [PATCH 2/2] Update release action to auth before release --- .github/workflows/release.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 975e02a..18ec355 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -30,5 +30,8 @@ jobs: if: steps.cache-dependencies.cache-hit != 'true' run: poetry install - - name: Test + - name: Authenticate to PyPI + run: poetry http-basic.pypi ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_PASSWORD }} + + - name: Release run: poetry run invoke release