From c94d47eeece470dc17c63c4b793831e7ff6d88e8 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 5 May 2025 14:14:31 +0200 Subject: [PATCH 1/2] docs: document releasing a new version Similar to Nextcloud Vue Signed-off-by: Ferdinand Thiessen --- .github/release.yml | 35 +++++++++++++++++++++++++++++++++++ README.md | 24 ++++++++++++++++++++++++ build/format-changelog.mjs | 24 ++++++++++++++++++++++++ package.json | 1 + 4 files changed, 84 insertions(+) create mode 100644 .github/release.yml create mode 100644 build/format-changelog.mjs diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..38efbdfc --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,35 @@ +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes +# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: CC0-1.0 +changelog: + exclude: + authors: + - dependabot + - dependabot[bot] + - nextcloud-bot + - nextcloud-command + labels: + - automated + - dependencies + - duplicate + - invalid + - l10n + - question + - wontfix + + categories: + - title: 🔐 Security + labels: + - security + - title: 💥 Breaking Changes + labels: + - breaking + - title: 🚀 Enhancements + labels: + - enhancement + - title: 🐛 Fixed bugs + labels: + - bug + - title: Other Changes + labels: + - "*" diff --git a/README.md b/README.md index 5b200bbf..9dbb8b98 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,27 @@ Nextcloud upload helpers for Nextcloud apps ## Usage 📘 [API documentation](https://nextcloud-libraries.github.io/nextcloud-upload) + +## Development + +### 📤 Releasing a new version + +- Pull the latest changes from `main` or `stableX` +- Checkout a new branch with the tag name (e.g `v4.0.1`): `git checkout -b v` +- 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](https://github.com/nextcloud-libraries/nextcloud-upload/releases) page. + Create a draft release, select the previous tag, click `generate` then paste the content to the `CHANGELOG.md` file + 1. 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)\)` + 2. use the the version as tag AND title (e.g `v4.0.1`) + 3. add the changelog content as description (https://github.com/nextcloud-libraries/nextcloud-upload/releases) +- Commit, push and create PR +- Get your PR reviewed and merged +- Create a milestone with the follow-up version at https://github.com/nextcloud-libraries/nextcloud-upload/milestones +- Move all open tickets and PRs to the follow-up +- Close the milestone of the version you release +- Publish the previously drafted release on GitHub + ![image](https://user-images.githubusercontent.com/14975046/124442568-2a952500-dd7d-11eb-82a2-402f9170231a.png) diff --git a/build/format-changelog.mjs b/build/format-changelog.mjs new file mode 100644 index 00000000..bde2a1ad --- /dev/null +++ b/build/format-changelog.mjs @@ -0,0 +1,24 @@ +/** + * SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +import { readFile, writeFile } from 'node:fs/promises' +import { join } from 'node:path' + +console.info('🔎 checking format of CHANGELOG.md') + +const file = join(import.meta.dirname, '..', 'CHANGELOG.md') +const content = await readFile(file, { encoding: 'utf-8' }) + +const formatted = content.replaceAll( + /by @([^ ]+) in ((https:\/\/github.com\/)nextcloud-libraries\/nextcloud-upload\/pull\/(\d+))/g, + '[\\#$4]($2) \\([$1]($3$1)\\)', +) + +if (formatted !== content) { + console.info('✏️ fixing format') + await writeFile(file, formatted) + console.info('🎉 done') +} else { + console.info('✅ no formatting needed - done.') +} diff --git a/package.json b/package.json index c624c39c..f35be6e8 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "scripts": { "build": "vite --mode production build", "build:doc": "typedoc --out dist/doc lib && touch dist/doc/.nojekyll", + "prerelease:format-changelog": "node build/format-changelog.mjs", "cypress": "cypress run --component", "cypress:gui": "cypress open --component", "dev": "vite --mode development build", From 35a1301e136af070e105175befe3f19efef20021 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 5 May 2025 14:15:07 +0200 Subject: [PATCH 2/2] chore: prepare v1.10.0 Signed-off-by: Ferdinand Thiessen --- CHANGELOG.md | 13 +++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b97bfb4..fec0287f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ --> # Changelog +## [v1.10.0](https://github.com/nextcloud-libraries/nextcloud-upload/tree/v1.10.0) \(2025-05-05\) + +### Added +* feat(Uploader): Enable chunked upload for public shares if supported [\#1705](https://github.com/nextcloud-libraries/nextcloud-upload/pull/1705) \([provokateurin](https://github.com/provokateurin)\) + +### Fixed +* fix(i18n): Corrected plural for multi. plural languages [\#1733](https://github.com/nextcloud-libraries/nextcloud-upload/pull/1733) \([rakekniven](https://github.com/rakekniven)\) + +### Changed +* chore(i18n): Improved grammar [\#1672](https://github.com/nextcloud-libraries/nextcloud-upload/pull/1672) \([rakekniven](https://github.com/rakekniven)\) +* chore(deps): Bump axios to 1.9.0 +* Updated translations + ## [v1.9.1](https://github.com/nextcloud-libraries/nextcloud-upload/tree/v1.9.1) \(2025-03-20\) ### Fixed diff --git a/package-lock.json b/package-lock.json index c4d3539a..46428a4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@nextcloud/upload", - "version": "1.9.1", + "version": "1.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@nextcloud/upload", - "version": "1.9.1", + "version": "1.10.0", "license": "AGPL-3.0-or-later", "dependencies": { "@nextcloud/auth": "^2.4.0", diff --git a/package.json b/package.json index f35be6e8..7d06994a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nextcloud/upload", - "version": "1.9.1", + "version": "1.10.0", "description": "Nextcloud file upload client", "keywords": [ "nextcloud",