File tree 1 file changed +17
-12
lines changed
1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change 9
9
build-and-publish :
10
10
runs-on : ubuntu-latest
11
11
environment : pypi-publish
12
-
12
+ env :
13
+ VIRTUAL_ENV : .venv
14
+ permissions :
15
+ # for trusted publishing
16
+ id-token : write
13
17
steps :
14
18
- name : Check out repository
15
19
uses : actions/checkout@v4
16
-
20
+ - name : Set up Python
21
+ uses : actions/setup-python@v5
22
+ with :
23
+ python-version : ' 3.11'
17
24
- name : Set up PDM
18
25
uses : pdm-project/setup-pdm@v4
19
26
with :
20
- python-version : 3.11
27
+ python-version : ' 3.11'
21
28
cache : true
22
-
23
29
- name : Install dependencies
24
- run : pdm install -v --dev
25
-
30
+ run : |
31
+ python -m venv ${{ env.VIRTUAL_ENV }}
32
+ pdm sync --verbose --dev
26
33
- name : Run tests
27
- run : python -m pytest
28
-
34
+ run : |
35
+ source ${{ env.VIRTUAL_ENV }}/bin/activate
36
+ python -m pytest
29
37
- name : Create GitHub release
30
38
uses : softprops/action-gh-release@v1
31
39
with :
32
40
name : Release ${{ github.ref }}
33
41
tag_name : ${{ github.ref }}
34
42
draft : false
35
43
prerelease : false
36
-
37
44
- name : Build and publish to PyPI
38
- env :
39
- PDM_PUBLISH_USERNAME : ${{ secrets.PDM_PUBLISH_USERNAME }}
40
- PDM_PUBLISH_PASSWORD : ${{ secrets.PDM_PUBLISH_PASSWORD }}
41
45
run : |
46
+ source ${{ env.VIRTUAL_ENV }}/bin/activate
42
47
pdm publish
You can’t perform that action at this time.
0 commit comments