|
5 | 5 | push:
|
6 | 6 | tags: v[0-9]+.[0-9]+.[0-9]+
|
7 | 7 |
|
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | + |
| 11 | + |
8 | 12 | jobs:
|
| 13 | + build: |
| 14 | + name: Build distribution |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout repository |
| 19 | + uses: actions/checkout@v4 |
| 20 | + - name: Setup Python |
| 21 | + uses: actions/setup-python@v4 |
| 22 | + with: |
| 23 | + python-version: '3.9' |
| 24 | + - name: Install pypa/build |
| 25 | + run: python3 -m pip install build --user |
| 26 | + - name: Build a binary wheel and a source tarball |
| 27 | + run: python3 -m build |
| 28 | + - name: Store the distribution packages |
| 29 | + uses: actions/upload-artifact@v3 |
| 30 | + with: |
| 31 | + name: python-package-distributions |
| 32 | + path: dist/ |
| 33 | + |
| 34 | + # TODO: Add logic to do github release too here |
| 35 | + |
9 | 36 | publish:
|
| 37 | + name: Publish to TestPyPI |
10 | 38 | runs-on: ubuntu-latest
|
| 39 | + environment: |
| 40 | + # name: pypi |
| 41 | + name: testpypi |
| 42 | + url: https://pypi.org/project/pyscript |
| 43 | + permissions: |
| 44 | + id-token: ${{ secrets.PYPI_TOKEN }} |
11 | 45 |
|
12 | 46 | steps:
|
13 |
| - - name: Check out repository |
14 |
| - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 |
15 |
| - - name: Set up python 3.9 |
16 |
| - uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4 |
| 47 | + - name: Download all the dists |
| 48 | + uses: actions/download-artifacts@v3 |
17 | 49 | with:
|
18 |
| - python-version: 3.9 |
19 |
| - - name: Install Poetry |
20 |
| - |
| 50 | + name: python-package-distributions |
| 51 | + path: dist/ |
| 52 | + - name: Publish release to PyPI |
| 53 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 54 | + # This is for testing |
21 | 55 | with:
|
22 |
| - virtualenvs-create: true |
23 |
| - virtualenvs-in-project: true |
24 |
| - - name: Install package dependencies |
25 |
| - run: poetry install --no-dev |
26 |
| - - name: Build package |
27 |
| - run: poetry build |
28 |
| - - name: Publish package |
29 |
| - run: | |
30 |
| - poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} |
31 |
| - poetry publish |
| 56 | + repository-url: https://test.pypi.org/legacy/ |
0 commit comments