From 28d7fcae8f4f33eaf637fbe3ee14cc2c5918d49c Mon Sep 17 00:00:00 2001 From: Sunyoung Yoo <17974113+YooSunYoung@users.noreply.github.com> Date: Thu, 18 Jun 2026 10:54:20 +0200 Subject: [PATCH 01/10] Add draft release step to GitHub Actions workflow --- .github/workflows/release.yml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9391d246b..0d37d8eb6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,7 @@ jobs: outputs: package: ${{ steps.parse.outputs.package }} version: ${{ steps.parse.outputs.version }} + tag: ${{ steps.parse.outputs.tag }} lastversion: ${{ steps.last-version-parse.outputs.lastversion }} env: DRYRUN: ${{ github.event_name == 'workflow_dispatch' }} @@ -39,6 +40,7 @@ jobs: fi PACKAGE="${TAG%%/*}" VERSION="${TAG#*/}" + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" echo "package=${PACKAGE}" >> "$GITHUB_OUTPUT" echo "version=${VERSION}" >> "$GITHUB_OUTPUT" - uses: actions/checkout@v6 @@ -99,6 +101,19 @@ jobs: with: packages-dir: dist/ + draft-release: + name: Publish release + needs: [ publish, determine-package ] + runs-on: ubuntu-slim + permissions: + contents: write + steps: + - name: Draft a release. + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ needs.determine-package.outputs.tag }} + run: gh release create ${TAG} --draft --title ${TAG} # Default title is not always the tag name. + docs: name: Build and publish docs needs: [ determine-package, publish ] @@ -112,7 +127,7 @@ jobs: assets: name: Upload docs - needs: [ docs, determine-package ] + needs: [ docs, determine-package, draft-release ] runs-on: ubuntu-24.04 permissions: contents: write @@ -128,14 +143,15 @@ jobs: mv docs_html documentation-${PACKAGE}-${VERSION} zip -r documentation-${PACKAGE}-${VERSION}.zip documentation-${PACKAGE}-${VERSION} - name: Upload release assets - uses: svenstaro/upload-release-action@v2 - with: - file: ./documentation-${{ needs.determine-package.outputs.package }}-${{ needs.determine-package.outputs.version }}.zip - overwrite: false + env: + GH_TOKEN: ${{ github.token }} + ASSET-FILE-PATH: ./documentation-${{ needs.determine-package.outputs.package }}-${{ needs.determine-package.outputs.version }}.zip + TAG: ${{ needs.determine-package.outputs.tag }} + run: gh release upload ${TAG} ${ASSET-FILE-PATH} --clobber # Overwrite existing assets of the same name. notes: name: Update notes - needs: [ determine-package, publish ] + needs: [ determine-package, publish, draft-release ] runs-on: ubuntu-slim if: ${{ always() && needs.determine-package.outputs.lastversion }} permissions: @@ -180,8 +196,8 @@ jobs: run: cat .ess_release_cache/${PACKAGE}-${VERSION}-${PACKAGE}-${LASTVERSION}-releasenote.md >> new-release-note.md - name: Check the generated note run: cat new-release-note.md - - name: Upload release note + - name: Upload release note and publish the release if: ${{ github.event_name != 'workflow_dispatch' }} env: GH_TOKEN: ${{ github.token }} - run: gh release edit ${PACKAGE}/${VERSION} --notes-file "new-release-note.md" + run: gh release edit ${PACKAGE}/${VERSION} --notes-file "new-release-note.md" --draft=false # Publish the release with the new note. From f0a45ab6928478eece4a4ec4151327bfdd4c6d27 Mon Sep 17 00:00:00 2001 From: Sunyoung Yoo <17974113+YooSunYoung@users.noreply.github.com> Date: Thu, 18 Jun 2026 11:41:45 +0200 Subject: [PATCH 02/10] Refactor release workflow dependencies and tags --- .github/workflows/release.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d37d8eb6..9853d0f78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,6 @@ jobs: outputs: package: ${{ steps.parse.outputs.package }} version: ${{ steps.parse.outputs.version }} - tag: ${{ steps.parse.outputs.tag }} lastversion: ${{ steps.last-version-parse.outputs.lastversion }} env: DRYRUN: ${{ github.event_name == 'workflow_dispatch' }} @@ -103,7 +102,7 @@ jobs: draft-release: name: Publish release - needs: [ publish, determine-package ] + needs: [ determine-package, publish ] runs-on: ubuntu-slim permissions: contents: write @@ -111,7 +110,7 @@ jobs: - name: Draft a release. env: GH_TOKEN: ${{ github.token }} - TAG: ${{ needs.determine-package.outputs.tag }} + TAG: ${{ needs.determine-package.outputs.package }}/${{ needs.determine-package.outputs.version }} run: gh release create ${TAG} --draft --title ${TAG} # Default title is not always the tag name. docs: @@ -146,12 +145,12 @@ jobs: env: GH_TOKEN: ${{ github.token }} ASSET-FILE-PATH: ./documentation-${{ needs.determine-package.outputs.package }}-${{ needs.determine-package.outputs.version }}.zip - TAG: ${{ needs.determine-package.outputs.tag }} + TAG: ${{ needs.determine-package.outputs.package }}/${{ needs.determine-package.outputs.version }} run: gh release upload ${TAG} ${ASSET-FILE-PATH} --clobber # Overwrite existing assets of the same name. notes: name: Update notes - needs: [ determine-package, publish, draft-release ] + needs: [ determine-package, draft-release ] runs-on: ubuntu-slim if: ${{ always() && needs.determine-package.outputs.lastversion }} permissions: From d978cb504cc95ab86dedf6c42ef0fc68c0a7952a Mon Sep 17 00:00:00 2001 From: Sunyoung Yoo <17974113+YooSunYoung@users.noreply.github.com> Date: Thu, 18 Jun 2026 11:42:11 +0200 Subject: [PATCH 03/10] Remove TAG echo from release.yml Removed echo statement for TAG in release workflow. --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9853d0f78..6045d5ca9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,6 @@ jobs: fi PACKAGE="${TAG%%/*}" VERSION="${TAG#*/}" - echo "tag=${TAG}" >> "$GITHUB_OUTPUT" echo "package=${PACKAGE}" >> "$GITHUB_OUTPUT" echo "version=${VERSION}" >> "$GITHUB_OUTPUT" - uses: actions/checkout@v6 From 49ef8aa9e5d15fb60d44d21c5f85a6ef680873c8 Mon Sep 17 00:00:00 2001 From: Sunyoung Yoo <17974113+YooSunYoung@users.noreply.github.com> Date: Thu, 18 Jun 2026 12:39:42 +0200 Subject: [PATCH 04/10] Rename publish release step to draft a release --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6045d5ca9..ef7502211 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,7 +100,7 @@ jobs: packages-dir: dist/ draft-release: - name: Publish release + name: Draft a release needs: [ determine-package, publish ] runs-on: ubuntu-slim permissions: From 113118c0683185cde1cd1469641092f369504229 Mon Sep 17 00:00:00 2001 From: YooSunYoung <17974113+YooSunYoung@users.noreply.github.com> Date: Thu, 18 Jun 2026 12:41:58 +0200 Subject: [PATCH 05/10] Remove subtitle. --- tools/collect-release-notes.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/collect-release-notes.py b/tools/collect-release-notes.py index 9949bcd87..a01d586f0 100644 --- a/tools/collect-release-notes.py +++ b/tools/collect-release-notes.py @@ -107,12 +107,7 @@ def has_label(label: str, pr: PRDescription) -> bool: else: maybe_relevant_logs.append(merge_log) - release_note = [ - "## What's Changed", - '', - f"### {package_name.replace('ess', 'ESS')}", - '', - ] + release_note = ["## What's Changed"] release_note.extend([f"* {relevant_log}" for relevant_log in relevant_logs]) if args.maybe_relevant: From 34e910d5e12d11d5d9aab5c2c682a4941a6f9453 Mon Sep 17 00:00:00 2001 From: Sunyoung Yoo <17974113+YooSunYoung@users.noreply.github.com> Date: Thu, 18 Jun 2026 16:51:27 +0200 Subject: [PATCH 06/10] Update PR string representation to use PR number --- tools/collect-release-notes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/collect-release-notes.py b/tools/collect-release-notes.py index a01d586f0..88203ea7a 100644 --- a/tools/collect-release-notes.py +++ b/tools/collect-release-notes.py @@ -39,7 +39,7 @@ class MergeLog(BaseModel): def __str__(self) -> str: authors = ", ".join([f"@{author.login}" for author in self.authors]) - return f"{self.pr.title} by {authors} in {self.pr.url}" + return f"{self.pr.title} by {authors} in #{self.pr.number}" def get_commits_file(cur_tag: str, compare_tag: str) -> pathlib.Path: From b93b00910d27890a7fd466cc7f7286a26457dd34 Mon Sep 17 00:00:00 2001 From: Sunyoung Yoo <17974113+YooSunYoung@users.noreply.github.com> Date: Thu, 18 Jun 2026 16:58:25 +0200 Subject: [PATCH 07/10] Update PR description format to include URL --- tools/collect-release-notes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/collect-release-notes.py b/tools/collect-release-notes.py index 88203ea7a..08f633e2b 100644 --- a/tools/collect-release-notes.py +++ b/tools/collect-release-notes.py @@ -39,7 +39,7 @@ class MergeLog(BaseModel): def __str__(self) -> str: authors = ", ".join([f"@{author.login}" for author in self.authors]) - return f"{self.pr.title} by {authors} in #{self.pr.number}" + return f"{self.pr.title} by {authors} in https://github.com/scipp/ess/pull/{self.pr.number}" def get_commits_file(cur_tag: str, compare_tag: str) -> pathlib.Path: From d3a6d0567f498c29e4096d48cf285fc234c55dca Mon Sep 17 00:00:00 2001 From: Sunyoung Yoo <17974113+YooSunYoung@users.noreply.github.com> Date: Tue, 30 Jun 2026 15:33:18 +0200 Subject: [PATCH 08/10] Modify draft release step to check release status Developers should be able to create a release using github release UI. In that case, the gh release create command will fail. --- .github/workflows/release.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef7502211..b6a821b56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,17 +100,21 @@ jobs: packages-dir: dist/ draft-release: - name: Draft a release + name: Draft a release or/and check the release needs: [ determine-package, publish ] runs-on: ubuntu-slim permissions: contents: write + env: + TAG: ${{ needs.determine-package.outputs.package }}/${{ needs.determine-package.outputs.version }} steps: - name: Draft a release. env: GH_TOKEN: ${{ github.token }} - TAG: ${{ needs.determine-package.outputs.package }}/${{ needs.determine-package.outputs.version }} run: gh release create ${TAG} --draft --title ${TAG} # Default title is not always the tag name. + continue-on-error: true # Release create can fail if there is an existing release. + - name: Check the release. + run: gh release view ${TAG} # This command should not fail. docs: name: Build and publish docs From 09ba1a2253f67f7279724d2abf3e5bc7f452d9e4 Mon Sep 17 00:00:00 2001 From: Sunyoung Yoo <17974113+YooSunYoung@users.noreply.github.com> Date: Tue, 30 Jun 2026 15:34:25 +0200 Subject: [PATCH 09/10] Update comment for release view command Clarify comment for release check command. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6a821b56..128743ab7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,7 +114,7 @@ jobs: run: gh release create ${TAG} --draft --title ${TAG} # Default title is not always the tag name. continue-on-error: true # Release create can fail if there is an existing release. - name: Check the release. - run: gh release view ${TAG} # This command should not fail. + run: gh release view ${TAG} # This command should not fail if the release already exists or was created by the previous step. docs: name: Build and publish docs From 6a8a54040e1d1a6d3a4f59d8690c95b0e5717d30 Mon Sep 17 00:00:00 2001 From: Sunyoung Yoo <17974113+YooSunYoung@users.noreply.github.com> Date: Tue, 30 Jun 2026 15:52:34 +0200 Subject: [PATCH 10/10] Remove unnecessary dependency Co-authored-by: Neil Vaytet <39047984+nvaytet@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 128743ab7..9ca996e86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,7 @@ jobs: publish: name: Publish to PyPI - needs: [ determine-package, build ] + needs: build runs-on: ubuntu-24.04 environment: release if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'workflow_dispatch' }}