Skip to content

Commit 77b8d99

Browse files
committed
ci: add PyPI publish workflow triggered on version tags
1 parent ddc105d commit 77b8d99

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0 # needed for setuptools_scm to derive version from tags
15+
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.13"
19+
20+
- name: Install build dependencies
21+
run: pip install build
22+
23+
- name: Build distributions
24+
run: python -m build
25+
26+
- name: Upload distributions as artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: dist
30+
path: dist/
31+
32+
publish:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: pypi
37+
url: https://pypi.org/p/carconnectivity-plugin-campermode
38+
permissions:
39+
id-token: write # required for OIDC trusted publisher
40+
41+
steps:
42+
- name: Download distributions
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: dist
46+
path: dist/
47+
48+
- name: Publish to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)