mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-02 12:47:41 +02:00
Server: Added script to create release
This commit is contained in:
parent
1dbeff1908
commit
fb01c64133
@ -1646,4 +1646,7 @@ packages/server/src/utils/urlUtils.js.map
|
|||||||
packages/server/src/utils/uuidgen.d.ts
|
packages/server/src/utils/uuidgen.d.ts
|
||||||
packages/server/src/utils/uuidgen.js
|
packages/server/src/utils/uuidgen.js
|
||||||
packages/server/src/utils/uuidgen.js.map
|
packages/server/src/utils/uuidgen.js.map
|
||||||
|
packages/tools/release-server.d.ts
|
||||||
|
packages/tools/release-server.js
|
||||||
|
packages/tools/release-server.js.map
|
||||||
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
|
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1635,4 +1635,7 @@ packages/server/src/utils/urlUtils.js.map
|
|||||||
packages/server/src/utils/uuidgen.d.ts
|
packages/server/src/utils/uuidgen.d.ts
|
||||||
packages/server/src/utils/uuidgen.js
|
packages/server/src/utils/uuidgen.js
|
||||||
packages/server/src/utils/uuidgen.js.map
|
packages/server/src/utils/uuidgen.js.map
|
||||||
|
packages/tools/release-server.d.ts
|
||||||
|
packages/tools/release-server.js
|
||||||
|
packages/tools/release-server.js.map
|
||||||
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
|
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
|
||||||
|
@ -7,12 +7,6 @@
|
|||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"addPackageCli": "lerna add --scope joplin",
|
|
||||||
"addPackageCliD": "lerna add --scope joplin -D",
|
|
||||||
"addPackageDesktop": "lerna add --scope @joplin/app-desktop",
|
|
||||||
"addPackageDesktopD": "lerna add --scope @joplin/app-desktop -D",
|
|
||||||
"addPackageMobile": "lerna add --scope @joplin/app-mobile",
|
|
||||||
"addPackageMobileD": "lerna add --scope @joplin/app-mobile -D",
|
|
||||||
"buildApiDoc": "npm start --prefix=packages/app-cli -- apidoc ../../readme/api/references/rest_api.md",
|
"buildApiDoc": "npm start --prefix=packages/app-cli -- apidoc ../../readme/api/references/rest_api.md",
|
||||||
"buildDoc": "./packages/tools/build-all.sh",
|
"buildDoc": "./packages/tools/build-all.sh",
|
||||||
"buildPluginDoc": "typedoc --name 'Joplin Plugin API Documentation' --mode file -theme './Assets/PluginDocTheme/' --readme './Assets/PluginDocTheme/index.md' --excludeNotExported --excludeExternals --excludePrivate --excludeProtected --out docs/api/references/plugin_api packages/lib/services/plugins/api/",
|
"buildPluginDoc": "typedoc --name 'Joplin Plugin API Documentation' --mode file -theme './Assets/PluginDocTheme/' --readme './Assets/PluginDocTheme/index.md' --excludeNotExported --excludeExternals --excludePrivate --excludeProtected --out docs/api/references/plugin_api packages/lib/services/plugins/api/",
|
||||||
@ -43,8 +37,7 @@
|
|||||||
"updateIgnored": "gulp updateIgnoredTypeScriptBuild",
|
"updateIgnored": "gulp updateIgnoredTypeScriptBuild",
|
||||||
"updatePluginTypes": "./packages/generator-joplin/updateTypes.sh",
|
"updatePluginTypes": "./packages/generator-joplin/updateTypes.sh",
|
||||||
"watch": "lerna run watch --stream --parallel",
|
"watch": "lerna run watch --stream --parallel",
|
||||||
"i": "lerna add --no-bootstrap --scope",
|
"i": "lerna add --no-bootstrap --scope"
|
||||||
"server-start-dev": "docker-compose --file docker-compose.server-dev.yml up"
|
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
@ -10,9 +10,9 @@ First copy `.env-sample` to `.env` and edit the values in there:
|
|||||||
## Install application
|
## Install application
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone https://github.com/laurent22/joplin
|
mkdir joplin && cd joplin
|
||||||
cd joplin
|
wget https://github.com/laurent22/joplin/archive/server-v1.6.3.tar.gz
|
||||||
npm install
|
tar xzvf server-v1.6.3.tar.gz
|
||||||
docker-compose --file docker-compose.server.yml up --detach
|
docker-compose --file docker-compose.server.yml up --detach
|
||||||
```
|
```
|
||||||
|
|
||||||
|
2
packages/server/package-lock.json
generated
2
packages/server/package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@joplin/server",
|
"name": "@joplin/server",
|
||||||
"version": "0.0.0",
|
"version": "1.6.3",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@joplin/server",
|
"name": "@joplin/server",
|
||||||
"version": "0.0.0",
|
"version": "1.6.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start-dev": "nodemon --config nodemon.json dist/app.js --env dev",
|
"start-dev": "nodemon --config nodemon.json dist/app.js --env dev",
|
||||||
|
15
packages/tools/package-lock.json
generated
15
packages/tools/package-lock.json
generated
@ -145,6 +145,15 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
|
||||||
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ=="
|
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ=="
|
||||||
},
|
},
|
||||||
|
"@types/fs-extra": {
|
||||||
|
"version": "9.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.6.tgz",
|
||||||
|
"integrity": "sha512-ecNRHw4clCkowNOBJH1e77nvbPxHYnWIXMv1IAoG/9+MYGkgoyr3Ppxr7XYFNL41V422EDhyV4/4SSK8L2mlig==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "14.14.6",
|
"version": "14.14.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz",
|
||||||
@ -4412,6 +4421,12 @@
|
|||||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"typescript": {
|
||||||
|
"version": "4.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz",
|
||||||
|
"integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"uc.micro": {
|
"uc.micro": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.5.tgz",
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"author": "Laurent Cozic",
|
"author": "Laurent Cozic",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"updateIgnored": "gulp updateIgnoredTypeScriptBuild"
|
"updateIgnored": "gulp updateIgnoredTypeScriptBuild",
|
||||||
|
"tsc": "tsc --project tsconfig.json",
|
||||||
|
"watch": "tsc --watch --project tsconfig.json"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
@ -34,9 +36,11 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rmp135/sql-ts": "^1.6.0",
|
"@rmp135/sql-ts": "^1.6.0",
|
||||||
|
"@types/fs-extra": "^9.0.6",
|
||||||
"@types/node": "^14.14.6",
|
"@types/node": "^14.14.6",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"sqlite3": "^5.0.0"
|
"sqlite3": "^5.0.0",
|
||||||
|
"typescript": "^4.1.3"
|
||||||
},
|
},
|
||||||
"gitHead": "80c0089d2c52aff608b2bea74389de5a7f12f2e2"
|
"gitHead": "80c0089d2c52aff608b2bea74389de5a7f12f2e2"
|
||||||
}
|
}
|
||||||
|
39
packages/tools/release-server.ts
Normal file
39
packages/tools/release-server.ts
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import * as fs from 'fs-extra';
|
||||||
|
const { execCommand, execCommandVerbose, rootDir, gitPullTry } = require('./tool-utils.js');
|
||||||
|
|
||||||
|
const serverDir = `${rootDir}/packages/server`;
|
||||||
|
const readmePath = `${serverDir}/README.md`;
|
||||||
|
|
||||||
|
async function updateReadmeLinkVersion(version: string) {
|
||||||
|
const content = await fs.readFile(readmePath, 'utf8');
|
||||||
|
const newContent = content.replace(/server-v(.*?).tar.gz/g, `server-${version}.tar.gz`);
|
||||||
|
if (content === newContent) throw new Error(`Could not change version number in ${readmePath}`);
|
||||||
|
await fs.writeFile(readmePath, newContent, 'utf8');
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
process.chdir(serverDir);
|
||||||
|
|
||||||
|
console.info(`Running from: ${process.cwd()}`);
|
||||||
|
|
||||||
|
await gitPullTry();
|
||||||
|
|
||||||
|
const version = (await execCommand('npm version patch')).trim();
|
||||||
|
const tagName = `server-${version}`;
|
||||||
|
|
||||||
|
console.info(`New version number: ${version}`);
|
||||||
|
|
||||||
|
await updateReadmeLinkVersion(version);
|
||||||
|
|
||||||
|
await execCommandVerbose('git', ['add', '-A']);
|
||||||
|
await execCommandVerbose('git', ['commit', '-m', `Server release ${version}`]);
|
||||||
|
await execCommandVerbose('git', ['tag', tagName]);
|
||||||
|
await execCommandVerbose('git', ['push']);
|
||||||
|
await execCommandVerbose('git', ['push', '--tags']);
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch((error) => {
|
||||||
|
console.error('Fatal error');
|
||||||
|
console.error(error);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
@ -79,6 +79,7 @@ async function main() {
|
|||||||
await updatePackageVersion(`${rootDir}/packages/app-desktop/package.json`, majorMinorVersion);
|
await updatePackageVersion(`${rootDir}/packages/app-desktop/package.json`, majorMinorVersion);
|
||||||
await updatePackageVersion(`${rootDir}/packages/app-cli/package.json`, majorMinorVersion);
|
await updatePackageVersion(`${rootDir}/packages/app-cli/package.json`, majorMinorVersion);
|
||||||
await updatePackageVersion(`${rootDir}/packages/generator-joplin/package.json`, majorMinorVersion);
|
await updatePackageVersion(`${rootDir}/packages/generator-joplin/package.json`, majorMinorVersion);
|
||||||
|
await updatePackageVersion(`${rootDir}/packages/server/package.json`, majorMinorVersion);
|
||||||
await updateGradleVersion(`${rootDir}/packages/app-mobile/android/app/build.gradle`, majorMinorVersion);
|
await updateGradleVersion(`${rootDir}/packages/app-mobile/android/app/build.gradle`, majorMinorVersion);
|
||||||
await updateCodeProjVersion(`${rootDir}/packages/app-mobile/ios/Joplin.xcodeproj/project.pbxproj`, iosVersionHack(majorMinorVersion));
|
await updateCodeProjVersion(`${rootDir}/packages/app-mobile/ios/Joplin.xcodeproj/project.pbxproj`, iosVersionHack(majorMinorVersion));
|
||||||
await updateClipperManifestVersion(`${rootDir}/packages/app-clipper/manifest.json`, majorMinorVersion);
|
await updateClipperManifestVersion(`${rootDir}/packages/app-clipper/manifest.json`, majorMinorVersion);
|
||||||
|
10
packages/tools/tsconfig.json
Normal file
10
packages/tools/tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"include": [
|
||||||
|
"**/*.ts",
|
||||||
|
"**/*.tsx",
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/node_modules"
|
||||||
|
],
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user