From c9343bbba08fbf2d1d46a40172bff3074bb70247 Mon Sep 17 00:00:00 2001 From: Siwat Tansiri Date: Sat, 8 Jun 2024 21:29:49 +0700 Subject: [PATCH] cd: add github action to release to pypi --- .github/workflows/release_new_version.yml | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/release_new_version.yml diff --git a/.github/workflows/release_new_version.yml b/.github/workflows/release_new_version.yml new file mode 100644 index 0000000..cd7458d --- /dev/null +++ b/.github/workflows/release_new_version.yml @@ -0,0 +1,31 @@ +name: Release new version + +on: + release: + types: [published] + +concurrency: + group: ${{ github.workflow }} + +jobs: + push_to_aws_ecr: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + - name: Install Python3.12.2 + uses: actions/setup-python@v5 + with: + python-version: '3.12.2' + - name: Install poetry + run: | + python -m pip install --user pipx + python -m pipx ensurepath + pipx install poetry + - name: Install dependencies + run: | + poetry install + - name: Config pypi token + run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN}} + - name: Build and publish + run: poetry publish --build