diff options
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/python-publish.yml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..9246d7e --- /dev/null +++ b/.github/workflows/python-publish.yml | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | name: Release | ||
| 2 | |||
| 3 | on: | ||
| 4 | push: | ||
| 5 | tags: | ||
| 6 | - 'v*' | ||
| 7 | pull_request: | ||
| 8 | branches: | ||
| 9 | - 'main' | ||
| 10 | |||
| 11 | jobs: | ||
| 12 | deploy: | ||
| 13 | runs-on: ubuntu-latest | ||
| 14 | steps: | ||
| 15 | - uses: actions/checkout@v2 | ||
| 16 | - name: Set up Python | ||
| 17 | uses: actions/setup-python@v2 | ||
| 18 | with: | ||
| 19 | python-version: '3.10' | ||
| 20 | - name: Set up Node | ||
| 21 | uses: actions/setup-node@v2 | ||
| 22 | with: | ||
| 23 | node-version: '16' | ||
| 24 | - name: Install node dependencies | ||
| 25 | run: | | ||
| 26 | yarn install | ||
| 27 | - name: Install python dependencies | ||
| 28 | run: | | ||
| 29 | python -m pip install --upgrade pip | ||
| 30 | pip install build | ||
| 31 | - name: Build package | ||
| 32 | run: | | ||
| 33 | yarn build | ||
| 34 | python -m build | ||
| 35 | - name: Publish package | ||
| 36 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
| 37 | if: github.event_name != 'pull_request' | ||
| 38 | with: | ||
| 39 | user: __token__ | ||
| 40 | password: ${{ secrets.PYPI_API_TOKEN }} | ||
