@@ -5,30 +5,33 @@ on: [push, pull_request]
5
5
env :
6
6
PYTEST_ADDOPTS : " --color=yes"
7
7
8
+ permissions :
9
+ contents : read
10
+
8
11
jobs :
9
12
test :
10
- name : Test - ${{ matrix.python-version }}
13
+ name : Test - Python ${{ matrix.python-version }}
11
14
runs-on : ubuntu-latest
12
15
strategy :
13
16
matrix :
14
- python-version : ["3.8", "3.9", "3.10", "3.11"]
17
+ python-version : ["3.8", "3.9", "3.10", "3.11", "3.12" ]
15
18
16
19
steps :
17
- - uses : actions/checkout@v3
20
+ - uses : actions/checkout@v4
18
21
- name : Set up Python ${{ matrix.python-version }}
19
- uses : actions/setup-python@v4
22
+ uses : actions/setup-python@v5
20
23
with :
21
24
python-version : ${{ matrix.python-version }}
22
25
- name : Set up Pip cache
23
- uses : actions/cache@v3
26
+ uses : actions/cache@v4
24
27
id : pip-cache
25
28
with :
26
29
path : ~/.cache/pip
27
30
key : pip-${{ hashFiles('**/pyproject.toml') }}
28
31
- name : Install Poetry
29
32
run : python -m pip install poetry
30
33
- name : Set up Poetry cache
31
- uses : actions/cache@v3
34
+ uses : actions/cache@v4
32
35
id : poetry-cache
33
36
with :
34
37
path : ~/.cache/pypoetry/virtualenvs
@@ -44,17 +47,17 @@ jobs:
44
47
runs-on : ubuntu-latest
45
48
46
49
steps :
47
- - uses : actions/checkout@v3
50
+ - uses : actions/checkout@v4
48
51
- name : Validate links in Markdown files
49
52
uses : JustinBeckwith/linkinator-action@v1
50
53
with :
51
54
retry : true
52
55
- name : Set up Python
53
- uses : actions/setup-python@v4
56
+ uses : actions/setup-python@v5
54
57
with :
55
- python-version : " 3.9 "
58
+ python-version : " 3.10 "
56
59
- name : Set Poetry cache
57
- uses : actions/cache@v3
60
+ uses : actions/cache@v4
58
61
id : poetry-cache
59
62
with :
60
63
path : ~/.cache/pypoetry/virtualenvs
@@ -72,29 +75,36 @@ jobs:
72
75
environment : Deployment
73
76
needs : [test, lint]
74
77
runs-on : ubuntu-latest
75
- if : ${{ github.ref=='refs/heads/main' && github.event_name!='pull_request' }}
78
+ if : github.ref=='refs/heads/main' && github.event_name!='pull_request'
79
+
80
+ permissions :
81
+ contents : write
82
+ id-token : write
76
83
77
84
steps :
78
- - uses : actions/checkout@v3
79
- - name : Setup Python
80
- uses : actions/setup-python@v4
85
+ - uses : actions/checkout@v4
86
+
87
+ - name : Set up Python
88
+ uses : actions/setup-python@v5
81
89
with :
82
- python-version : " 3.9"
90
+ python-version : " 3.10"
91
+
83
92
- name : Check release
84
93
id : check_release
85
94
run : |
86
- python -m pip install --upgrade pip
87
- python -m pip install poetry githubrelease httpx==0.16.1 autopub
88
- echo "##[set-output name=release;]$(autopub check)"
95
+ python -m pip install autopub[github]
96
+ autopub check
97
+
89
98
- name : Publish
90
- if : ${{ steps.check_release.outputs.release =='' }}
99
+ if : ${{ steps.check_release.outputs.autopub_release =='true ' }}
91
100
env :
92
- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
93
- PYPI_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
101
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
94
102
run : |
95
- git remote set-url origin https://[email protected] /${{ github.repository }}
96
103
autopub prepare
97
- poetry build
98
104
autopub commit
105
+ autopub build
99
106
autopub githubrelease
100
- poetry publish -u __token__ -p $PYPI_PASSWORD
107
+
108
+ - name : Upload package to PyPI
109
+ if : ${{ steps.check_release.outputs.autopub_release=='true' }}
110
+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments