Skip to content

Commit 84c2d73

Browse files
gh action auto-publish (#270)
* gh action publish * update publish gh action * Update publish.yml update the publish.yml file to add a name to the Retrieve Release Distributions step and add some linting spaces --------- Co-authored-by: Gautzilla <72027971+Gautzilla@users.noreply.github.com>
1 parent 1ce8864 commit 84c2d73

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v5
16+
with:
17+
version: "0.7.8"
18+
enable-cache: true
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version-file: "pyproject.toml"
24+
25+
- name: Install the project
26+
run: uv sync --locked --all-extras --dev
27+
28+
- name: Build distributions
29+
run: uv build
30+
31+
- name: Upload distributions
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: dist
35+
path: dist/*
36+
37+
publish:
38+
runs-on: ubuntu-latest
39+
40+
needs: build
41+
42+
permissions:
43+
id-token: write
44+
contents: read
45+
46+
environment:
47+
name: pypi
48+
url: https://pypi.org/project/osekit/
49+
50+
steps:
51+
- name: Retrieve release distributions
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: dist
55+
path: dist/
56+
57+
- name: Publish package distributions to PyPI
58+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)