Skip to content
Merged
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
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,24 @@ For testing all components provide `data-testid` attributes as selectors, so the
`row-checkbox` | Checkbox for selecting a row
`row-name` | Name of the row / file

### 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<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;
- Commit, push and create PR;
- Add the change log content from the 'Changelog' action on Github to `CHANGELOG.md`;
- Commit and push;
- Get your PR reviewed and merged;
- Create [a release on github](https://github.com/nextcloud-libraries/nextcloud-dialogs/releases) with the version as tag (e.g `v4.0.1`) and add the changelog content as description

![image](https://user-images.githubusercontent.com/14975046/124442568-2a952500-dd7d-11eb-82a2-402f9170231a.png)
### 📤 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<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](https://github.com/nextcloud-libraries/nextcloud-dialogs/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-dialogs/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
- 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-dialogs/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)
24 changes: 24 additions & 0 deletions build/format-changelog.mjs
Original file line number Diff line number Diff line change
@@ -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-dialogs\/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.')
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"dev": "vite --mode development build",
"dev:watch": "vite --mode development build --watch",
"doc": "typedoc --tsconfig tsconfig-typedoc.json --highlightLanguages vue --plugin typedoc-plugin-missing-exports --out dist/doc dist/index.d.ts dist/filepicker.d.ts && touch dist/doc/.nojekyll",
"prerelease:format-changelog": "node build/format-changelog.mjs",
"lint": "eslint lib/",
"lint:fix": "eslint --fix lib/",
"stylelint": "stylelint lib/**/*.vue",
Expand Down