|
35 | 35 | with: |
36 | 36 | attest-build-provenance-github: 'true' |
37 | 37 |
|
| 38 | + generate-gh-release-notes: |
| 39 | + needs: [package] |
| 40 | + runs-on: ubuntu-latest |
| 41 | + timeout-minutes: 30 |
| 42 | + permissions: |
| 43 | + contents: read |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v5 |
| 46 | + with: |
| 47 | + fetch-depth: 0 |
| 48 | + persist-credentials: false |
| 49 | + |
| 50 | + - name: Set up Python |
| 51 | + uses: actions/setup-python@v6 |
| 52 | + with: |
| 53 | + python-version: "3.11" |
| 54 | + |
| 55 | + - name: Install tox |
| 56 | + run: | |
| 57 | + python -m pip install --upgrade pip |
| 58 | + pip install --upgrade tox |
| 59 | +
|
| 60 | + - name: Generate release notes |
| 61 | + env: |
| 62 | + VERSION: ${{ github.event.inputs.version }} |
| 63 | + run: | |
| 64 | + sudo apt-get install pandoc |
| 65 | + tox -e generate-gh-release-notes -- "$VERSION" gh-release-notes.md |
| 66 | +
|
| 67 | + - name: Upload release notes |
| 68 | + uses: actions/upload-artifact@v4 |
| 69 | + with: |
| 70 | + name: release-notes |
| 71 | + path: gh-release-notes.md |
| 72 | + retention-days: 1 |
| 73 | + |
38 | 74 | deploy: |
39 | 75 | if: github.repository == 'pytest-dev/pytest' |
40 | | - needs: [package] |
| 76 | + # Need generate-gh-release-notes only for ordering. |
| 77 | + # Don't want to release to PyPI if generating GitHub release notes fails. |
| 78 | + needs: [package, generate-gh-release-notes] |
41 | 79 | runs-on: ubuntu-latest |
42 | 80 | environment: deploy |
43 | 81 | timeout-minutes: 30 |
@@ -69,48 +107,28 @@ jobs: |
69 | 107 | git tag --annotate --message=v"$VERSION" "$VERSION" ${{ github.sha }} |
70 | 108 | git push origin "$VERSION" |
71 | 109 |
|
72 | | - release-notes: |
73 | | - |
74 | | - # todo: generate the content in the build job |
75 | | - # the goal being of using a github action script to push the release data |
76 | | - # after success instead of creating a complete python/tox env |
77 | | - needs: [deploy] |
| 110 | + create-github-release: |
| 111 | + needs: [generate-gh-release-notes, deploy] |
78 | 112 | runs-on: ubuntu-latest |
79 | | - timeout-minutes: 30 |
| 113 | + timeout-minutes: 10 |
80 | 114 | permissions: |
81 | 115 | contents: write |
82 | 116 | steps: |
83 | | - - uses: actions/checkout@v5 |
84 | | - with: |
85 | | - fetch-depth: 0 |
86 | | - persist-credentials: false |
87 | | - |
88 | 117 | - name: Download Package |
89 | 118 | uses: actions/download-artifact@v6 |
90 | 119 | with: |
91 | 120 | name: Packages |
92 | 121 | path: dist |
93 | 122 |
|
94 | | - - name: Set up Python |
95 | | - uses: actions/setup-python@v6 |
| 123 | + - name: Download release notes |
| 124 | + uses: actions/download-artifact@v6 |
96 | 125 | with: |
97 | | - python-version: "3.11" |
98 | | - |
99 | | - - name: Install tox |
100 | | - run: | |
101 | | - python -m pip install --upgrade pip |
102 | | - pip install --upgrade tox |
103 | | -
|
104 | | - - name: Generate release notes |
105 | | - env: |
106 | | - VERSION: ${{ github.event.inputs.version }} |
107 | | - run: | |
108 | | - sudo apt-get install pandoc |
109 | | - tox -e generate-gh-release-notes -- "$VERSION" scripts/latest-release-notes.md |
| 126 | + name: release-notes |
| 127 | + path: . |
110 | 128 |
|
111 | 129 | - name: Publish GitHub Release |
112 | 130 | env: |
113 | 131 | VERSION: ${{ github.event.inputs.version }} |
114 | 132 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
115 | 133 | run: | |
116 | | - gh release create --notes-file scripts/latest-release-notes.md --verify-tag "$VERSION" dist/* |
| 134 | + gh release create --notes-file gh-release-notes.md --verify-tag "$VERSION" dist/* |
0 commit comments