Skip to content

Commit d523340

Browse files
committed
ci: Move step for creating a GitHub release to the job that creates the release notes.
This addresses an issue with the step having elevated rights.
1 parent 154ea14 commit d523340

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,12 @@ jobs:
143143
fail_ci_if_error: true
144144
token: ${{ secrets.CODECOV_TOKEN }}
145145

146-
prepare-release-notes:
147-
name: Prepare Release Notes
148-
needs: [lint]
146+
create-github-release:
147+
name: Create GitHub release
148+
needs: [lint, check]
149149
runs-on: ubuntu-latest
150+
permissions:
151+
contents: write
150152
steps:
151153
- name: Checkout
152154
uses: actions/checkout@v4
@@ -182,6 +184,20 @@ jobs:
182184
with:
183185
name: release-notes.md
184186
path: release-notes.md
187+
- name: Download distributions
188+
uses: actions/download-artifact@v4
189+
with:
190+
name: dist
191+
path: dist
192+
- name: Create GitHub Release
193+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
194+
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
195+
with:
196+
name: pytest-asyncio ${{ needs.lint.outputs.version }}
197+
artifacts: dist/*
198+
bodyFile: release-notes.md
199+
prerelease: ${{ needs.lint.outputs.prerelease }}
200+
token: ${{ secrets.GITHUB_TOKEN }}
185201

186202
publish-test-pypi:
187203
name: Publish packages to test.pypi.org
@@ -206,10 +222,9 @@ jobs:
206222
name: Publish packages to pypi.org
207223
environment: release
208224
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
209-
needs: [lint, check, prepare-release-notes]
225+
needs: [lint, check]
210226
runs-on: ubuntu-latest
211227
permissions:
212-
contents: write
213228
id-token: write
214229
steps:
215230
- name: Download distributions
@@ -222,16 +237,3 @@ jobs:
222237
tree dist
223238
- name: PyPI upload
224239
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
225-
- name: Download Release Notes
226-
uses: actions/download-artifact@v4
227-
with:
228-
name: release-notes.md
229-
path: release-notes.md
230-
- name: GitHub Release
231-
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
232-
with:
233-
name: pytest-asyncio ${{ needs.lint.outputs.version }}
234-
artifacts: dist/*
235-
bodyFile: release-notes.md
236-
prerelease: ${{ needs.lint.outputs.prerelease }}
237-
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)