Skip to content

Commit 24b78a8

Browse files
committed
builtins release workflow
1 parent 1388762 commit 24b78a8

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/release.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Publish Python distribution to PyPI and TestPyPI
2+
3+
on:
4+
pull_request:
5+
types: ["synchronize"]
6+
7+
jobs:
8+
build:
9+
name: Build distribution
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
submodules: true
15+
fetch-depth: 0
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.x"
20+
21+
- name: Install pypa/build
22+
run: python3 -m pip install build --user
23+
- name: Build a binary wheel and a source tarball
24+
run: python3 -m build ua-parser-builtins
25+
- run: mv ua/parser-builtins/dist .
26+
- name: Store the distribution packages
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
publish-to-testpypi:
33+
name: Publish to TestPyPI
34+
needs:
35+
- build
36+
runs-on: ubuntu-latest
37+
38+
environment:
39+
name: testpypi
40+
url: https://test.pypi.org/p/ua-parser-builtins
41+
42+
permissions:
43+
id-token: write
44+
45+
steps:
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
- name: Publish
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
with:
54+
repository-url: https://test.pypi.org/legacy/
55+
56+
publish-to-pypi:
57+
name: publish
58+
if: false
59+
needs:
60+
- build
61+
runs-on: ubuntu-latest
62+
environment:
63+
name: pypi
64+
url: https://pypi.org/p/ua-parser-builtins
65+
permissions:
66+
id-token: write
67+
68+
steps:
69+
- name: Download all the dists
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: python-package-distributions
73+
path: dist/
74+
- name: Publish
75+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)