Merge pull request #14 from Kidev/wasm #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Python π distributions π¦ to PyPI | |
on: | |
push: | |
branches: | |
- master | |
- releases/* | |
- rel-* | |
tags: | |
- v* | |
jobs: | |
build-n-publish: | |
name: Build and publish Python π distributions π¦ to PyPI | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 50 | |
- name: Fetch release tag | |
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- name: Set up Python 3.12π | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install build and twine | |
run: python -m pip install build twine --user | |
- name: Build release assets | |
run: python -m build ./ | |
- name: twine check | |
run: python -m twine check dist/* | |
- name: Publish distribution π¦ to Test PyPI when releases branch | |
if: ${{ startsWith(github.event.ref, 'refs/heads/releases') }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.testpypi_password }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Publish distribution π¦ to PyPI | |
if: ${{ startsWith(github.event.ref, 'refs/tags') }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.pypi_password }} |