From 97fb3a8c295d559a14317f627c5d33d7b61b9945 Mon Sep 17 00:00:00 2001 From: dromanov Date: Sun, 29 Mar 2026 22:49:12 +0300 Subject: [PATCH 1/4] feat(workflows): add gh release instead of ncipollo/release-action --- .github/workflows/main.yml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7695faae..ad15e930 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -193,16 +193,32 @@ jobs: path: dist - name: Create GitHub Release if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0 - with: - name: pytest-asyncio ${{ needs.build.outputs.version }} - artifacts: dist/* - bodyFile: release-notes.md - prerelease: ${{ needs.build.outputs.prerelease }} - token: ${{ secrets.GITHUB_TOKEN }} - allowUpdates: true - draft: true - skipIfReleaseExists: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ needs.build.outputs.version }} + PRERELEASE: ${{ needs.build.outputs.prerelease }} + run: | + TAG_NAME="${GITHUB_REF#refs/tags/}" + + IS_DRAFT=$(gh release view "${TAG_NAME}" --json isDraft --jq '.isDraft' 2>/dev/null || echo "") + if [ -n "${IS_DRAFT}" ]; then + if [ "${IS_DRAFT}" = "false" ]; then + exit 0 + fi + gh release edit "${TAG_NAME}" \ + --title "pytest-asyncio ${VERSION}" \ + --notes-file release-notes.md \ + --draft + + gh release upload "${TAG_NAME}" dist/* --clobber + else + gh release create "${TAG_NAME}" \ + --title "pytest-asyncio ${VERSION}" \ + --notes-file release-notes.md \ + --draft \ + $( [ "${PRERELEASE}" = "true" ] && echo "--prerelease" ) \ + dist/* + fi publish-test-pypi: name: Publish packages to test.pypi.org From 6e621285babd08c99feaea84f3517dd8d16bb112 Mon Sep 17 00:00:00 2001 From: dromanov Date: Tue, 31 Mar 2026 02:40:12 +0300 Subject: [PATCH 2/4] docs: add newsfragment --- changelog.d/1392.changed.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/1392.changed.rst diff --git a/changelog.d/1392.changed.rst b/changelog.d/1392.changed.rst new file mode 100644 index 00000000..691964e8 --- /dev/null +++ b/changelog.d/1392.changed.rst @@ -0,0 +1 @@ +Change ``ncipollo/release-action`` on ``gh release`` From 0dcce492387b3f88b544057584c3795e337ec7cd Mon Sep 17 00:00:00 2001 From: dromanov Date: Wed, 1 Apr 2026 11:24:27 +0300 Subject: [PATCH 3/4] fix: make linters happy --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad15e930..aa2a1416 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -209,7 +209,7 @@ jobs: --title "pytest-asyncio ${VERSION}" \ --notes-file release-notes.md \ --draft - + gh release upload "${TAG_NAME}" dist/* --clobber else gh release create "${TAG_NAME}" \ From f3278d7533df1d6306688c1f0cd4fe4e7628c719 Mon Sep 17 00:00:00 2001 From: dromanov Date: Mon, 6 Apr 2026 23:49:33 +0300 Subject: [PATCH 4/4] refactor: apply suggestions from code review * remove `changed` file * simplify main.yaml * replace VERSION to TAG_NAME in title Co-authored-by: Michael Seifert --- .github/workflows/main.yml | 18 ++++-------------- changelog.d/1392.changed.rst | 1 - 2 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 changelog.d/1392.changed.rst diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa2a1416..94d4185c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -195,25 +195,15 @@ jobs: if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ needs.build.outputs.version }} PRERELEASE: ${{ needs.build.outputs.prerelease }} run: | TAG_NAME="${GITHUB_REF#refs/tags/}" - IS_DRAFT=$(gh release view "${TAG_NAME}" --json isDraft --jq '.isDraft' 2>/dev/null || echo "") - if [ -n "${IS_DRAFT}" ]; then - if [ "${IS_DRAFT}" = "false" ]; then - exit 0 - fi - gh release edit "${TAG_NAME}" \ - --title "pytest-asyncio ${VERSION}" \ - --notes-file release-notes.md \ - --draft - - gh release upload "${TAG_NAME}" dist/* --clobber - else + gh release view "${TAG_NAME}" >/dev/null + RELEASE_EXISTS=$? + if [ $RELEASE_EXISTS -ne 0 ]; then gh release create "${TAG_NAME}" \ - --title "pytest-asyncio ${VERSION}" \ + --title "pytest-asyncio ${TAG_NAME}" \ --notes-file release-notes.md \ --draft \ $( [ "${PRERELEASE}" = "true" ] && echo "--prerelease" ) \ diff --git a/changelog.d/1392.changed.rst b/changelog.d/1392.changed.rst deleted file mode 100644 index 691964e8..00000000 --- a/changelog.d/1392.changed.rst +++ /dev/null @@ -1 +0,0 @@ -Change ``ncipollo/release-action`` on ``gh release``