File tree Expand file tree Collapse file tree 4 files changed +70
-21
lines changed Expand file tree Collapse file tree 4 files changed +70
-21
lines changed Original file line number Diff line number Diff line change 11name : deploy
22
33on :
4- push :
5- tags :
6- - " v*"
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' Release version'
8+ required : true
9+ default : ' 1.2.3'
10+
711jobs :
12+
13+ package :
14+ runs-on : ubuntu-latest
15+ env :
16+ SETUPTOOLS_SCM_PRETEND_VERSION : ${{ github.event.inputs.version }}
17+
18+ steps :
19+ - uses : actions/checkout@v3
20+
21+ - name : Build and Check Package
22+ uses : hynek/build-and-inspect-python-package@v1.5
23+
824 deploy :
25+ needs : package
926 runs-on : ubuntu-latest
27+ environment : deploy
28+ permissions :
29+ id-token : write # For PyPI trusted publishers.
30+ contents : write # For tag and release notes.
1031
1132 steps :
12- - uses : actions/checkout@v1
33+ - uses : actions/checkout@v3
1334
14- - name : Set up Python
15- uses : actions/setup-python@v1
35+ - name : Download Package
36+ uses : actions/download-artifact@v3
1637 with :
17- python-version : " 3.9"
38+ name : Packages
39+ path : dist
1840
19- - name : Install dependencies
20- run : |
21- python -m pip install --upgrade pip
22- pip install build
41+ - name : Publish package to PyPI
42+ uses : pypa/gh-action-pypi-publish@v1.8.5
2343
24- - name : Build package
44+ - name : Push tag
2545 run : |
26- python -m build
46+ git config user.name "pytest bot"
47+ git config user.email "pytestbot@gmail.com"
48+ git tag --annotate --message=v${{ github.event.inputs.version }} v${{ github.event.inputs.version }} ${{ github.sha }}
49+ git push origin v${{ github.event.inputs.version }}
2750
28- - name : Publish package to PyPI
29- uses : pypa/gh-action-pypi-publish@master
30- with :
31- user : __token__
32- password : ${{ secrets.pypi_token }}
51+ - name : GitHub Release
52+ uses : softprops/action-gh-release@v1
Original file line number Diff line number Diff line change 66 - " *"
77 pull_request :
88
9+ concurrency :
10+ group : ${{ github.workflow }}-${{ github.ref }}
11+ cancel-in-progress : true
12+
913jobs :
1014 compile :
1115
5357 !tests/**/*.xml
5458 !tests/**/*.o
5559
60+ package :
61+ runs-on : ubuntu-latest
62+ steps :
63+ - uses : actions/checkout@v3
64+ - name : Build and Check Package
65+ uses : hynek/build-and-inspect-python-package@v1.5
66+
5667 test :
57- needs : compile
68+ needs : [ compile, package]
5869 runs-on : ubuntu-latest
5970
6071 strategy :
@@ -79,15 +90,25 @@ jobs:
7990 uses : actions/setup-python@v2
8091 with :
8192 python-version : ${{ matrix.python }}
93+
8294 - name : Download compiled tests
83- uses : actions/download-artifact@v2
95+ uses : actions/download-artifact@v3
8496 with :
8597 name : tests
8698 path : tests
99+
100+ - name : Download Package
101+ uses : actions/download-artifact@v3
102+ with :
103+ name : Packages
104+ path : dist
105+
87106 - name : Install Tox
88107 run : |
89108 chmod a+x -R tests
90109 pip install tox
110+
91111 - name : Test
112+ shell : bash
92113 run : |
93- tox -e ${{ matrix.tox_env }}
114+ tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz`
Original file line number Diff line number Diff line change 1+ Here are the steps on how to make a new release.
2+
3+ 1. Create a ``release-VERSION `` branch from ``upstream/main ``.
4+ 2. Update ``CHANGELOG.rst ``.
5+ 3. Push the branch to ``upstream ``.
6+ 4. Once all tests pass, start the ``deploy `` workflow manually.
7+ 5. Merge the PR.
Original file line number Diff line number Diff line change 1919 author_email = "nicoddemus@gmail.com" ,
2020 description = "Use pytest's runner to discover and execute C++ tests" ,
2121 long_description = open ("README.rst" ).read (),
22+ long_description_content_type = "text/x-rst" ,
2223 license = "MIT" ,
2324 keywords = "pytest test unittest" ,
2425 url = "http://github.com/pytest-dev/pytest-cpp" ,
You can’t perform that action at this time.
0 commit comments