Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Jupyter releaser #186

Merged
merged 1 commit into from
May 26, 2021
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
52 changes: 50 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,60 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
set -eux
git checkout -b release
npm install -g verdaccio
verdaccio --config .github/scripts/verdaccio.yml &
npm set registry http://localhost:4873/
yarn config set registry http://localhost:4873/
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
yarn run version patch --no-push --yes
yarn run update:versions patch --yes
git commit -a -m "Update versions"
yarn run publish

check_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: '14.x'

# Cache yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
shell: bash
run: |
set -eux
npm install -g yarn
yarn

- name: Cache checked links
uses: actions/cache@v2
with:
path: ~/.cache/pytest-link-check
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
restore-keys: |
${{ runner.os }}-linkcheck-

- name: Install Dependencies
run: |
yarn

- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ docs/api
*.code-workspace
.history
.vscode

.jupyter_releaser_checkout
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

<!-- <START NEW CHANGELOG ENTRY> -->

## 2021-5-20

([Full Changelog](https://github.com/jupyterlab/lumino/compare/2021.5.10...e2b775392b42e98d5c58b9afdc74e92b1631739b))
Expand All @@ -20,13 +22,14 @@
- Fix changelog formatting for 2021-5-10 entry [#185](https://github.com/jupyterlab/lumino/pull/185) ([@blink1073](https://github.com/blink1073))
- Add changelog entry for 2021.5.10 [#184](https://github.com/jupyterlab/lumino/pull/184) ([@blink1073](https://github.com/blink1073))


### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyterlab/lumino/graphs/contributors?from=2021-05-10&to=2021-05-20&type=c))

[@blink1073](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Ablink1073+updated%3A2021-05-10..2021-05-20&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Adependabot+updated%3A2021-05-10..2021-05-20&type=Issues) | [@ibdafna](https://github.com/search?q=repo%3Ajupyterlab%2Flumino+involves%3Aibdafna+updated%3A2021-05-10..2021-05-20&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 2021-5-10

([Full Changelog](https://github.com/jupyterlab/lumino/compare/2021.4.27...f8466b274fe801bb06931572893fb938808eb2b8))
Expand Down Expand Up @@ -428,8 +431,8 @@
@lumino/application@1.10.1
@lumino/algorithm@1.3.1

- fix columnCount signature [#82](https://github.com/jupyterlab/lumino/pull/82) ([@mbektasbbg](https://github.com/mbektasbbg))
- unsubscribe from grid wheel events on editor dispose [#80](https://github.com/jupyterlab/lumino/pull/80) ([@mbektasbbg](https://github.com/mbektasbbg))
- fix columnCount signature [#82](https://github.com/jupyterlab/lumino/pull/82) ([@mbektas](https://github.com/mbektas))
- unsubscribe from grid wheel events on editor dispose [#80](https://github.com/jupyterlab/lumino/pull/80) ([@mbektas](https://github.com/mbektas))
- chore(build): Bump Typescript to 3.9.2 [#75](https://github.com/jupyterlab/lumino/pull/75) ([@GordonSmith](https://github.com/GordonSmith))

## 2020-5-23
Expand Down Expand Up @@ -582,7 +585,7 @@

- Remove 'sourceMap' from tsconfig in `@lumino/virtualdom` [#41](https://github.com/jupyterlab/lumino/pull/41) ([@zemeolotu](https://github.com/zemeolotu))
- Start a change log [#38](https://github.com/jupyterlab/lumino/pull/38) ([@blink1073](https://github.com/blink1073))
- DataGrid Cell Editing [#14](https://github.com/jupyterlab/lumino/pull/14) ([@mbektasbbg](https://github.com/mbektasbbg))
- DataGrid Cell Editing [#14](https://github.com/jupyterlab/lumino/pull/14) ([@mbektas](https://github.com/mbektas))

## 2020-1-8

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Lumino is a subproject of Project Jupyter and subject to the [Jupyter governance

## General Guidelines

For general documentation about contributing to Jupyter projects, see the [Project Jupyter Contributor Documentation](https://jupyter.readthedocs.io/en/latest/contributor/content-contributor.html).
For general documentation about contributing to Jupyter projects, see the [Project Jupyter Contributor Documentation](https://jupyter.readthedocs.io/en/latest/contributing/content-contributor.html).

## Setting up a development environment

Expand Down
21 changes: 19 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Release instructions for Lumino

## Using `jupyter_releaser`

The recommended way to make a release is to use [`jupyter_releaser`](https://github.com/jupyter-server/jupyter_releaser#checklist-for-adoption).

Because `lumino` uses independent versions, the versioning must be
done manually as follows:

```bash
yarn
yarn run update:versions
git push origin
```

## Manual Release

To create a manual release, perform the following steps:

Check for releases since the last published version to determine appropriate
patch/minor/major version changes.
If a dependent package moves by minor/major, then that package needs to jump
Expand All @@ -8,8 +25,8 @@ minor/major as well.
```bash
git clean -dfx
yarn
yarn run version
# Update the changelog with published packages (minor or higher) and included PRs.
yarn run update:versions
# Update the changelog with changed packages (minor or higher) and included PRs.
# Tag the release with the date, e.g. 2021.4.9
#
yarn run publish
Expand Down
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"version": "0.0.0",
"version": "2021.4.27",
"name": "lumino-top-level",
"private": true,
"workspaces": [
"examples/*",
Expand All @@ -20,20 +21,29 @@
"docs": "rimraf docs/api && lerna run build:src --concurrency 1 && lerna run docs",
"get:dependency": "get-dependency",
"minimize": "lerna run minimize",
"publish": "npm run clean && npm run build:dist && lerna publish --yes -m \"Publish\" from-package",
"publish": "npm run clean && npm run build:dist && node scripts/tag-versions.js && lerna publish --yes -m \"Publish\" from-package",
"remove:dependency": "remove-dependency",
"test": "lerna run test --scope \"@lumino/!(example-)*\"",
"test:examples": "lerna run test --scope \"@lumino/example-*\"",
"test:chrome": "lerna run test:chrome",
"test:firefox": "lerna run test:firefox",
"test:ie": "lerna run test:ie --concurrency 1",
"update:dependency": "update-dependency --lerna",
"version": "lerna version"
"update:versions": "lerna version --no-push --no-git-tag-version"
},
"dependencies": {},
"devDependencies": {
"@jupyterlab/buildutils": "^1.0.0",
"lerna": "^3.19.0",
"typedoc": "^0.20.32"
},
"jupyter-releaser": {
"options": {
"ignore-links": ["./api/index.html"]
},
"hooks": {
"after-build-changelog": "node scripts/format-changelog.js",
"before-build-npm": ["yarn build:dist", "node scripts/tag-versions.js"]
}
}
}
8 changes: 4 additions & 4 deletions packages/datagrid/src/textrenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ class TextRenderer extends CellRenderer {
}
}
}
// Multiple words in column header. Fitting maximum

// Multiple words in column header. Fitting maximum
// number of words possible per line (box width).
else {
while (wordsInColumn.length !== 0) {
Expand All @@ -282,7 +282,7 @@ class TextRenderer extends CellRenderer {
gc.fillText(textInCurrentLine, textX, curY);
curY += textHeight;
textInCurrentLine = curWord!;
}
}
else {
// The combined text hasd a width less than the box width. We
// set the the current line text to be the new combined text.
Expand Down Expand Up @@ -310,7 +310,7 @@ class TextRenderer extends CellRenderer {
text = text.substring(0, text.length - 2) + elide;
}
textWidth = gc.measureText(text).width;
}
}
} else {
while ((textWidth > boxWidth) && (text.length > 1)) {
if (text.length > 4 && textWidth >= 2 * boxWidth) {
Expand Down
41 changes: 41 additions & 0 deletions scripts/format-changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const path = require('path');
const fs = require('fs');
const utils = require('@jupyterlab/buildutils');

// Add version changes to the changelog entry
const package = JSON.parse(fs.readFileSync('package.json', { encoding: 'utf-8' }));
const versions = [];

let changelog = fs.readFileSync('CHANGELOG.md', { encoding: 'utf-8' });
const firstIndex = changelog.indexOf('<!-- <START NEW CHANGELOG ENTRY> -->');
const lastIndex = changelog.indexOf('<!-- <END NEW CHANGELOG ENTRY> -->');
const entry = changelog.slice(firstIndex, lastIndex);

// For each package, compare the local version to the published version
fs.readdirSync('packages').forEach(pkgName => {
const localPath = path.join('packages', pkgName, 'package.json');
const localPackage = JSON.parse(fs.readFileSync(localPath, { encoding: 'utf-8' }));
const name = localPackage.name;
const version = localPackage.version;
const remoteVersion = utils.run(`npm info ${name} version`, { stdio: 'pipe' }, true);
if (version !== remoteVersion) {
versions.push(` ${name}: ${remoteVersion} => ${version}`);
}
});

// Splice the entry
if (versions) {
const lines = entry.split('\n');
let index = -1;
lines.forEach((line, i) => {
if (line.startsWith('([Full Changelog]')) {
index = i + 1;
}
});
if (index != -1) {
const newEntry = lines.slice(0, index).concat([''], versions, lines.slice(index, -1), ['']);
changelog = changelog.replace(entry, newEntry.join('\n'));
}
}

fs.writeFileSync('CHANGELOG.md', changelog, { encoding: 'utf-8' });
16 changes: 16 additions & 0 deletions scripts/tag-versions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const path = require('path');
const fs = require('fs');
const utils = require('@jupyterlab/buildutils');

// Get the list of tags
const tags = utils.run('git tag', { stdio: 'pipe' }, true).split('\n');

// For each package, compare the local version to the published version
fs.readdirSync('packages').forEach(pkgName => {
const localPath = path.join('packages', pkgName, 'package.json');
const localPackage = JSON.parse(fs.readFileSync(localPath, { encoding: 'utf-8' }));
const tag = `${localPackage.name}@${localPackage.version}`;
if (tags.indexOf(tag) === -1) {
utils.run(`git tag ${tag} -a -m "Release ${tag}"`)
}
});