Skip to content

Commit cae8d6c

Browse files
authored
Use new manual deployment workflow (#42)
As well as creating the package only once and test on all platforms.
1 parent a6eaa34 commit cae8d6c

File tree

4 files changed

+50
-19
lines changed

4 files changed

+50
-19
lines changed

.github/workflows/deploy.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@ on:
1010

1111
jobs:
1212

13-
deploy:
13+
package:
1414
runs-on: ubuntu-latest
15-
environment: deploy
16-
permissions:
17-
id-token: write # For PyPI trusted publishers.
18-
contents: write # For tag and release notes.
1915
env:
2016
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
2117

@@ -25,6 +21,17 @@ jobs:
2521
- name: Build and Check Package
2622
uses: hynek/[email protected]
2723

24+
deploy:
25+
needs: package
26+
runs-on: ubuntu-latest
27+
environment: deploy
28+
permissions:
29+
id-token: write # For PyPI trusted publishers.
30+
contents: write # For tag.
31+
32+
steps:
33+
- uses: actions/checkout@v3
34+
2835
- name: Download Package
2936
uses: actions/download-artifact@v3
3037
with:
@@ -36,5 +43,7 @@ jobs:
3643

3744
- name: Push tag
3845
run: |
39-
git tag ${{ github.event.inputs.version }} ${{ github.sha }}
40-
git push origin ${{ github.event.inputs.version }}
46+
git config user.name "pytest bot"
47+
git config user.email "[email protected]"
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 }}

.github/workflows/test.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
name: test
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- "test-me-*"
8+
9+
pull_request:
10+
branches:
11+
- "*"
412

513
# Cancel running jobs for the same workflow and branch.
614
concurrency:
715
group: ${{ github.workflow }}-${{ github.ref }}
816
cancel-in-progress: true
917

1018
jobs:
19+
package:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Build and Check Package
24+
uses: hynek/[email protected]
25+
1126
test:
27+
needs: [package]
1228

1329
runs-on: ${{ matrix.os }}
1430

@@ -31,21 +47,24 @@ jobs:
3147

3248
steps:
3349
- uses: actions/checkout@v3
50+
51+
- name: Download Package
52+
uses: actions/download-artifact@v3
53+
with:
54+
name: Packages
55+
path: dist
56+
3457
- name: Set up Python
3558
uses: actions/setup-python@v4
3659
with:
3760
python-version: ${{ matrix.python }}
61+
3862
- name: Install tox
3963
run: |
4064
python -m pip install --upgrade pip
41-
pip install --upgrade virtualenv tox
65+
pip install tox
66+
4267
- name: Test
68+
shell: bash
4369
run: |
44-
tox -e ${{ matrix.tox_env }}
45-
46-
check-package:
47-
runs-on: ubuntu-latest
48-
steps:
49-
- uses: actions/checkout@v3
50-
- name: Build and Check Package
51-
uses: hynek/[email protected]
70+
tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz`

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,6 @@ venv.bak/
104104
.mypy_cache/
105105

106106
src/pytest_reportlog/_version.py
107+
108+
# PyCharm
109+
.idea/

RELEASING.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ Here are the steps on how to make a new release.
22

33
1. Create a ``release-VERSION`` branch from ``upstream/main``.
44
2. Update ``CHANGELOG.rst``.
5-
3. Push the branch to ``upstream``.
6-
4. Once all tests pass, start the ``deploy`` workflow manually.
5+
3. Push the branch to ``upstream`` and open a PR.
6+
4. Once all tests pass, start the ``deploy`` workflow manually from the branch ``release-VERSION``, passing ``VERSION`` as parameter.
77
5. Merge the PR.

0 commit comments

Comments
 (0)