Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ jobs:
with:
packages-dir: dist/

draft-release:
name: Draft a release
needs: [ determine-package, publish ]
runs-on: ubuntu-slim
permissions:
contents: write
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.

docs:
name: Build and publish docs
needs: [ determine-package, publish ]
Expand All @@ -112,7 +125,7 @@ jobs:

assets:
name: Upload docs
needs: [ docs, determine-package ]
needs: [ docs, determine-package, draft-release ]
runs-on: ubuntu-24.04
permissions:
contents: write
Expand All @@ -128,14 +141,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.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 ]
needs: [ determine-package, draft-release ]
runs-on: ubuntu-slim
if: ${{ always() && needs.determine-package.outputs.lastversion }}
permissions:
Expand Down Expand Up @@ -180,8 +194,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.
9 changes: 2 additions & 7 deletions tools/collect-release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 https://github.com/scipp/ess/pull/{self.pr.number}"


def get_commits_file(cur_tag: str, compare_tag: str) -> pathlib.Path:
Expand Down Expand Up @@ -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:
Expand Down