Skip to content

Commit d34460e

Browse files
committed
Add initial test pypi release workflow
1 parent c54a2bd commit d34460e

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/test-release.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
persist-credentials: false
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.x"
18+
19+
- name: Install Node
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: '14'
23+
24+
- name: Install npm dependencies
25+
run: >-
26+
cd js
27+
npm ci
28+
npm run build
29+
30+
- name: Install pypa/build
31+
run: >-
32+
python3 -m
33+
pip install
34+
build
35+
--user
36+
- name: Build a binary wheel and a source tarball
37+
run: python3 -m build
38+
- name: Store the distribution packages
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: python-package-distributions
42+
path: dist/
43+
44+
publish-to-testpypi:
45+
name: Publish Python 🐍 distribution 📦 to TestPyPI
46+
needs:
47+
- build
48+
runs-on: ubuntu-latest
49+
50+
environment:
51+
name: testpypi
52+
url: https://test.pypi.org/p/plotly
53+
54+
permissions:
55+
id-token: write # IMPORTANT: mandatory for trusted publishing
56+
57+
steps:
58+
- name: Download all the dists
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: python-package-distributions
62+
path: dist/
63+
- name: Publish distribution 📦 to TestPyPI
64+
uses: pypa/gh-action-pypi-publish@release/v1
65+
with:
66+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)