You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This workflow will upload a Python Package to PyPI when a release is created
2
-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
-
4
-
# This workflow uses actions that are not certified by GitHub.
5
-
# They are provided by a third-party and are governed by
6
-
# separate terms of service, privacy policy, and support
7
-
# documentation.
8
-
9
-
name: pygrokai
1
+
name: Publish to PyPI
10
2
11
3
on:
12
4
release:
@@ -16,7 +8,7 @@ permissions:
16
8
contents: read
17
9
18
10
jobs:
19
-
release-build:
11
+
test-and-build:
20
12
runs-on: ubuntu-latest
21
13
22
14
steps:
@@ -26,11 +18,19 @@ jobs:
26
18
with:
27
19
python-version: "3.x"
28
20
21
+
- name: Install dependencies
22
+
run: |
23
+
python -m pip install --upgrade pip
24
+
pip install poetry
25
+
poetry install
26
+
27
+
- name: Run tests
28
+
run: |
29
+
poetry run pytest
30
+
29
31
- name: Build release distributions
30
32
run: |
31
-
# NOTE: put your own distribution build steps here.
32
-
python -m pip install build
33
-
python -m build
33
+
poetry build
34
34
35
35
- name: Upload distributions
36
36
uses: actions/upload-artifact@v4
@@ -40,22 +40,12 @@ jobs:
40
40
41
41
pypi-publish:
42
42
runs-on: ubuntu-latest
43
-
needs:
44
-
- release-build
43
+
needs: test-and-build
45
44
permissions:
46
-
# IMPORTANT: this permission is mandatory for trusted publishing
47
45
id-token: write
48
46
49
-
# Dedicated environments with protections for publishing are strongly recommended.
50
-
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
47
environment:
52
48
name: pypi
53
-
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
-
# url: https://pypi.org/p/YOURPROJECT
55
-
#
56
-
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
-
# ALTERNATIVE: exactly, uncomment the following line instead:
0 commit comments