Skip to content

Commit

Permalink
chore(repo): use multi-semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip committed Jun 9, 2023
1 parent d9ca009 commit 84faec8
Show file tree
Hide file tree
Showing 17 changed files with 973 additions and 1,628 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ commands:
steps:
- checkout
- cached-dependencies
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- build

jobs:
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"test.karma": "karma start",
"prepare": "husky install",
"prerelease": "patch-package",
"release": "yarn prerelease && yarn workspaces foreach run release",
"publish:release": "yarn npm publish",
"release": "yarn prerelease && multi-semantic-release --deps.bump=satisfy",
"jest": "jest"
},
"workspaces": {
Expand Down Expand Up @@ -75,8 +74,8 @@
"@octokit/core": "^3.5.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "https://registry.npmjs.org/@achingbrain/semantic-release-github/-/semantic-release-github-0.0.2.tgz",
"@semantic-release/npm": "^10.0.3",
"@semantic-release/github": "^8.1.0",
"@semantic-release/npm": "^9.0.2",
"@semantic-release/release-notes-generator": "^10.0.3",
"@swc/core": "^1.2.210",
"@swc/jest": "^0.2.21",
Expand All @@ -90,7 +89,6 @@
"@types/text-table": "^0.2.2",
"@typescript-eslint/eslint-plugin": "^5.34.0",
"@typescript-eslint/parser": "^5.34.0",
"@w4rlock/semantic-release-plugin-decorators": "^1.0.3",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
Expand All @@ -109,11 +107,11 @@
"karma-typescript-es6-transform": "^5.5.3",
"lint-staged": "^11.2.6",
"memfs": "^3.3.0",
"multi-semantic-release": "^3.0.2",
"node-powershell": "^4.0.0",
"patch-package": "^6.4.7",
"prettier": "^2.4.1",
"semantic-release": "^21.0.2",
"semantic-release-monorepo": "https://registry.npmjs.org/@achingbrain/semantic-release-monorepo/-/semantic-release-monorepo-8.0.0.tgz",
"semantic-release": "^19.0.5",
"ts-jest": "^28.0.5",
"ts-node": "^10.8.2",
"typescript": "^4.4.4"
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"build.windows": "pkg . --targets windows --out-path ./binaries",
"build.nix": "pkg . --targets linux,macos,alpine --out-path ./binaries",
"cli": "node -r ts-node/register/transpile-only -r tsconfig-paths/register src/index.ts",
"cli:debug": "node -r ts-node/register/transpile-only -r tsconfig-paths/register --inspect-brk src/index.ts",
"release": "semantic-release -e semantic-release-monorepo"
"cli:debug": "node -r ts-node/register/transpile-only -r tsconfig-paths/register --inspect-brk src/index.ts"
},
"dependencies": {
"@stoplight/json": "~3.20.1",
Expand Down
3 changes: 0 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
"engines": {
"node": "^12.20 || >= 14.13"
},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@stoplight/better-ajv-errors": "1.0.3",
"@stoplight/json": "~3.20.1",
Expand Down
3 changes: 0 additions & 3 deletions packages/formats/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
"engines": {
"node": ">=12"
},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@stoplight/json": "^3.17.0",
"@stoplight/spectral-core": "^1.8.0",
Expand Down
1 change: 0 additions & 1 deletion packages/formatters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"url": "https://github.com/stoplightio/spectral.git"
},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo",
"pretest": "yarn prebuild",
"prelint": "yarn prebuild",
"prebuild": "node scripts/bundle-html-templates.mjs"
Expand Down
3 changes: 0 additions & 3 deletions packages/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
"engines": {
"node": ">=12"
},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@stoplight/better-ajv-errors": "1.0.3",
"@stoplight/json": "^3.17.1",
Expand Down
3 changes: 0 additions & 3 deletions packages/parsers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
"type": "git",
"url": "https://github.com/stoplightio/spectral.git"
},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@stoplight/json": "~3.20.1",
"@stoplight/types": "^13.6.0",
Expand Down
3 changes: 0 additions & 3 deletions packages/ref-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
"type": "git",
"url": "https://github.com/stoplightio/spectral.git"
},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@stoplight/json-ref-readers": "1.2.2",
"@stoplight/json-ref-resolver": "~3.1.5",
Expand Down
3 changes: 0 additions & 3 deletions packages/ruleset-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
"type": "git",
"url": "https://github.com/stoplightio/spectral.git"
},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@rollup/plugin-commonjs": "~22.0.2",
"@stoplight/path": "1.3.2",
Expand Down
3 changes: 1 addition & 2 deletions packages/ruleset-migrator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
},
"scripts": {
"pretest": "ts-node -T ./scripts/generate-test-fixtures.ts && yarn prebuild",
"prebuild": "ts-node -T ./scripts/compile-schemas.ts",
"release": "semantic-release -e semantic-release-monorepo"
"prebuild": "ts-node -T ./scripts/compile-schemas.ts"
}
}
3 changes: 0 additions & 3 deletions packages/rulesets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
"type": "git",
"url": "https://github.com/stoplightio/spectral.git"
},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@asyncapi/specs": "^4.1.0",
"@stoplight/better-ajv-errors": "1.0.3",
Expand Down
3 changes: 0 additions & 3 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
"type": "git",
"url": "https://github.com/stoplightio/spectral.git"
},
"scripts": {
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@stoplight/json": "^3.20.1",
"@stoplight/path": "^1.3.2",
Expand Down
34 changes: 34 additions & 0 deletions patches/@semantic-release+github+8.0.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/node_modules/@semantic-release/github/index.js b/node_modules/@semantic-release/github/index.js
index fa549f0..7cf7f61 100644
--- a/node_modules/@semantic-release/github/index.js
+++ b/node_modules/@semantic-release/github/index.js
@@ -3,7 +3,6 @@
const {defaultTo, castArray} = require('lodash');
const verifyGitHub = require('./lib/verify');
const addChannelGitHub = require('./lib/add-channel');
-const publishGitHub = require('./lib/publish');
const successGitHub = require('./lib/success');
const failGitHub = require('./lib/fail');

@@ -28,15 +27,6 @@ async function verifyConditions(pluginConfig, context) {
verified = true;
}

-async function publish(pluginConfig, context) {
- if (!verified) {
- await verifyGitHub(pluginConfig, context);
- verified = true;
- }
-
- return publishGitHub(pluginConfig, context);
-}
-
async function addChannel(pluginConfig, context) {
if (!verified) {
await verifyGitHub(pluginConfig, context);
@@ -64,4 +54,4 @@ async function fail(pluginConfig, context) {
await failGitHub(pluginConfig, context);
}

-module.exports = {verifyConditions, addChannel, publish, success, fail};
+module.exports = {verifyConditions, addChannel, success, fail};
13 changes: 13 additions & 0 deletions patches/multi-semantic-release+3.0.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/multi-semantic-release/lib/multiSemanticRelease.js b/node_modules/multi-semantic-release/lib/multiSemanticRelease.js
index 912a363..e651119 100644
--- a/node_modules/multi-semantic-release/lib/multiSemanticRelease.js
+++ b/node_modules/multi-semantic-release/lib/multiSemanticRelease.js
@@ -191,7 +191,7 @@ async function releasePackage(pkg, createInlinePlugin, multiContext, flags) {
// Add the package name into tagFormat.
// Thought about doing a single release for the tag (merging several packages), but it's impossible to prevent Github releasing while allowing NPM to continue.
// It'd also be difficult to merge all the assets into one release without full editing/overriding the plugins.
- options.tagFormat = name + "@${version}";
+ options.tagFormat = name + "-${version}";

// This options are needed for plugins that do not rely on `pluginOptions` and extract them independently.
options._pkgOptions = pkgOptions;
28 changes: 0 additions & 28 deletions patches/semantic-release+21.0.2.patch

This file was deleted.

Loading

0 comments on commit 84faec8

Please sign in to comment.