Skip to content

Commit

Permalink
Fix publish CI (#2746)
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox authored Oct 8, 2024
1 parent 5a6faab commit 915f0c3
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .releaseconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plugins": ["iobroker", "license", "lerna"],
"plugins": ["iobroker", "license"],
"ioPackage": "packages/admin",
"exec": {
"before_commit": "npm run build"
"before_commit": "npm run build && npm run bump-versions"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"devDependencies": {
"@alcalzone/release-script": "^3.8.0",
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
"@alcalzone/release-script-plugin-lerna": "^3.7.0",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@iobroker/build-tools": "^2.0.6"
},
"scripts": {
"build": "node tasks",
"build": "node tasks --build",
"bump-versions": "node tasks --bump-versions",
"install-monorepo": "npm i && npm i -w packages/dm-gui-components && npm i -w packages/jsonConfig && npm i -w packages/admin cd packages/admin/src-admin && npm i -f",
"npm": "npm run install-monorepo",
"start": "npm run start -w packages/admin",
Expand Down
4 changes: 3 additions & 1 deletion packages/dm-gui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@
},
"homepage": "https://github.com/ioBroker/dm-gui-components#readme",
"dependencies": {
"@iobroker/json-config": "file:../jsonConfig"
},
"devDependencies": {
"@craco/craco": "^7.1.0",
"@iobroker/adapter-react-v5": "^7.2.4",
"@iobroker/dm-utils": "^0.5.0",
"@iobroker/eslint-config": "^0.1.6",
"@iobroker/json-config": "file:../jsonConfig",
"@iobroker/types": "^7.0.0",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
Expand Down
10 changes: 6 additions & 4 deletions packages/jsonConfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"access": "public"
},
"dependencies": {
"react-qr-code": "^2.0.15",
"crypto-js": "^4.2.0",
"react-color": "^2.19.3",
"react-ace": "^12.0.0"
},
"devDependencies": {
"@craco/craco": "^7.1.0",
"@iobroker/adapter-react-v5": "^7.2.4",
"@iobroker/eslint-config": "^0.1.6",
Expand All @@ -24,12 +30,8 @@
"@types/react": "^18.3.11",
"@types/react-color": "^3.0.12",
"@types/react-dom": "^18.3.0",
"crypto-js": "^4.2.0",
"react": "^18.3.1",
"react-ace": "^12.0.0",
"react-color": "^2.19.3",
"react-dom": "^18.3.1",
"react-qr-code": "^2.0.15",
"tsc-alias": "^1.8.10",
"typescript": "^5.6.2"
},
Expand Down
40 changes: 35 additions & 5 deletions tasks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { exec } = require('node:child_process');
const { existsSync } = require('node:fs');
const { existsSync, readFileSync, writeFileSync } = require('node:fs');

const COLORS = {
RED: '\x1b[31m',
Expand Down Expand Up @@ -82,7 +82,37 @@ async function build() {
}
log('-------------- END --------------', COLORS.RED);
}
build().catch(e => {
console.error(e);
process.exit(1);
});
if (process.argv.includes('--build')) {
build().catch(e => {
console.error(e);
process.exit(1);
});
} else if (process.argv.includes('--bump-versions')) {
// read the version in package/admin
const packAdmin = JSON.parse(readFileSync(`${__dirname}/packages/admin/package.json`).toString());
const version = packAdmin.version;
// replace in JsonConfig the version
const packJsonConfig = JSON.parse(readFileSync(`${__dirname}/packages/jsonConfig/package.json`).toString());
packJsonConfig.version = version;
log(`Set the version in jsonConfig/package.json to ${packJsonConfig.version}`, COLORS.CYAN);
writeFileSync(`${__dirname}/packages/jsonConfig/package.json`, JSON.stringify(packJsonConfig, null, 4));

// replace in JsonConfig the version
const packDmComponents = JSON.parse(readFileSync(`${__dirname}/packages/dm-gui-components/package.json`).toString());
packDmComponents.version = version;
packDmComponents.dependencies['@iobroker/json-config'] = version;
packAdmin.devDependencies['@iobroker/dm-gui-components'] = version;
packAdmin.devDependencies['@iobroker/json-config'] = version;
log(`Set the version in dm-gui-components/package.json to ${packDmComponents.version}`, COLORS.GREEN);
writeFileSync(`${__dirname}/packages/dm-gui-components/package.json`, JSON.stringify(packDmComponents, null, 4));

// const packAdminGuiComponents = JSON.parse(readFileSync(`${__dirname}/packages/admin/src-admin/package.json`).toString());
// packAdminGuiComponents.version = version;
// packAdminGuiComponents.dependencies['@iobroker/dm-gui-components'] = version;
// packAdminGuiComponents.dependencies['@iobroker/json-config'] = version;
// log(`Set the version in admin/src-admin/package.json to ${packAdminGuiComponents.version}`, COLORS.YELLOW);
// writeFileSync(`${__dirname}/packages/admin/src-admin/package.json`, JSON.stringify(packAdminGuiComponents, null, 4));

log(`Set the version in admin/package.json to ${packAdmin.version}`, COLORS.MAGENTA);
writeFileSync(`${__dirname}/packages/admin/package.json`, JSON.stringify(packAdmin, null, 4));
}

0 comments on commit 915f0c3

Please sign in to comment.