Checkout a new branch with the tag name (e.g v4.0.1): git checkout -b v<version>
Run npm version patch --no-git-tag-version (npm version minor --no-git-tag-version if minor).
This will return a new version name, make sure it matches what you expect
Generate the changelog content from the release page.
Create a draft release, select the previous tag, click generate then paste the content to the CHANGELOG.md file
adjust the links to the merged pull requests and authors so that the changelog also works outside of GitHub
by running npm run prerelease:format-changelog.
This will apply this regex: by @([^ ]+) in ((https://github.com/)nextcloud-libraries/nextcloud-upload/pull/(\d+))
Which this as the replacement: [\#$4]($2) \([$1]($3$1)\)