From 8531b68e2f112a90ea550beb56267ed7aacdc453 Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Tue, 15 Aug 2023 19:13:04 +0900 Subject: [PATCH] Fix deploy script (#244) --- .github/workflows/release.yml | 44 +++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2cd0277..59cb951 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,28 +1,32 @@ -name: Upload Python Package +name: deploy on: - release: - types: [published] + push: + +permissions: + contents: read + +concurrency: + group: main-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: - build: + deploy: runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + environment: PyPi-deploy steps: - - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v3 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build + - uses: actions/checkout@v3 - - name: Build package - run: python -m build + - uses: actions/setup-python@v3 - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - name: Install requirements and build wheel + shell: bash -l {0} + run: | + python -m pip install build twine + python -m build . + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}