Skip to content

Commit 6820ab2

Browse files
authored
Merge pull request #9795 from pytest-dev/backport-9794-to-7.1.x
[7.1.x] Split test/deploy workflows
2 parents 0ceaa57 + f1c2760 commit 6820ab2

File tree

3 files changed

+59
-46
lines changed

3 files changed

+59
-46
lines changed

.github/workflows/deploy.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
tags:
6+
# These tags are protected, see:
7+
# https://github.com/pytest-dev/pytest/settings/tag_protection
8+
- "[0-9]+.[0-9]+.[0-9]+"
9+
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
10+
11+
12+
# Set permissions at the job level.
13+
permissions: {}
14+
15+
jobs:
16+
17+
deploy:
18+
if: github.repository == 'pytest-dev/pytest'
19+
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 30
22+
permissions:
23+
contents: write
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
with:
28+
fetch-depth: 0
29+
persist-credentials: false
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: "3.7"
35+
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install --upgrade build tox
40+
41+
- name: Build package
42+
run: |
43+
python -m build
44+
45+
- name: Publish package to PyPI
46+
uses: pypa/gh-action-pypi-publish@master
47+
with:
48+
user: __token__
49+
password: ${{ secrets.pypi_token }}
50+
51+
- name: Publish GitHub release notes
52+
env:
53+
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}
54+
run: |
55+
sudo apt-get install pandoc
56+
tox -e publish-gh-release-notes

.github/workflows/main.yml renamed to .github/workflows/test.yml

+1-44
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: main
1+
name: test
22

33
on:
44
push:
@@ -187,46 +187,3 @@ jobs:
187187
fail_ci_if_error: true
188188
files: ./coverage.xml
189189
verbose: true
190-
191-
deploy:
192-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest'
193-
194-
runs-on: ubuntu-latest
195-
timeout-minutes: 30
196-
permissions:
197-
contents: write
198-
199-
needs: [build]
200-
201-
steps:
202-
- uses: actions/checkout@v2
203-
with:
204-
fetch-depth: 0
205-
persist-credentials: false
206-
207-
- name: Set up Python
208-
uses: actions/setup-python@v2
209-
with:
210-
python-version: "3.7"
211-
212-
- name: Install dependencies
213-
run: |
214-
python -m pip install --upgrade pip
215-
pip install --upgrade build tox
216-
217-
- name: Build package
218-
run: |
219-
python -m build
220-
221-
- name: Publish package to PyPI
222-
uses: pypa/gh-action-pypi-publish@master
223-
with:
224-
user: __token__
225-
password: ${{ secrets.pypi_token }}
226-
227-
- name: Publish GitHub release notes
228-
env:
229-
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}
230-
run: |
231-
sudo apt-get install pandoc
232-
tox -e publish-gh-release-notes

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
:target: https://codecov.io/gh/pytest-dev/pytest
2121
:alt: Code coverage Status
2222

23-
.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg
24-
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain
23+
.. image:: https://github.com/pytest-dev/pytest/workflows/test/badge.svg
24+
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest
2525

2626
.. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg
2727
:target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main

0 commit comments

Comments
 (0)