Skip to content

Commit

Permalink
ci: update packaging workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
NekoAria committed Nov 13, 2023
1 parent 89e6190 commit 03251ff
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,34 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4.7.1
with:
python-version: ${{matrix.python-version}}
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Build package
run: poetry build
- name: Publish package

# Define an environment variable to control the upload of sdist
- name: Set UPLOAD_SDIST variable
run: echo "UPLOAD_SDIST=${{ matrix.python-version == '3.8' }}" >> $GITHUB_ENV

- name: Build wheel
run: poetry build --format wheel

# Conditionally build and publish sdist
- name: Build and publish sdist
if: env.UPLOAD_SDIST == 'true'
run: poetry build --format sdist
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

# Always publish wheel
- name: Publish wheel
run: poetry publish --format wheel
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{secrets.TESTPYPI_TOKEN}}
password: ${{ secrets.TESTPYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

0 comments on commit 03251ff

Please sign in to comment.