Skip to content

Commit 6f959e6

Browse files
committed
Initial work on publish workflow
1 parent 6bbce99 commit 6f959e6

File tree

1 file changed

+42
-17
lines changed

1 file changed

+42
-17
lines changed

.github/workflows/publish.yaml

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,52 @@ on:
55
push:
66
tags: v[0-9]+.[0-9]+.[0-9]+
77

8+
workflow_dispatch:
9+
10+
11+
812
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+
936
publish:
37+
name: Publish to TestPyPI
1038
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 }}
1145

1246
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
1749
with:
18-
python-version: 3.9
19-
- name: Install Poetry
20-
uses: snok/[email protected]
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
2155
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

Comments
 (0)