1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Automate release (#2977)

* release-it/bumper

* remove git:false

* fix package ordering

* adjust git add

* fix git config

* adjust git config for all packages

* add noop release script for test-utils

* no need to try to release root

* better way to handle skipping

* pass parameters down

* better version hint

* update node version

* return git arguments from before

* rename release workflow

* rename workflow

* set git.tagMatch

* add link to docs

* update description

* update workspace order in package-lock

* fix secondary releases

release-it/bumper was removing the ^ before the peerDep to client
npm is not happy with that. one potential fix would be to bump all
packages together as a prestep and then proceed without bupming again.
for now, this fix should bring us to the previous state ( what was used
in the manual process )

* require clean working dir in root

* remove root release-it config

not needed
This commit is contained in:
Nikolay Karadzhov
2025-06-04 10:52:14 +03:00
committed by GitHub
parent 20c16e0c2c
commit b33a662e50
17 changed files with 1641 additions and 2679 deletions

50
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release ("major", "minor", "patch", or "pre*" version; or specify version like "5.3.3")'
required: true
type: string
args:
description: 'Additional arguments to pass to release-it (e.g. "--dry-run"). See docs: https://github.com/release-it/release-it/blob/main/docs/git.md#configuration-options'
required: false
type: string
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Configure Git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# Build all packages
- name: Build packages
run: npm run build
# Release using the monorepo approach
- name: Release packages
run: npm run release -- --ci -i ${{ github.event.inputs.version }} ${{ github.event.inputs.args }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

4101
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,26 +2,35 @@
"name": "redis-monorepo",
"private": true,
"workspaces": [
"./packages/*"
"./packages/client",
"./packages/test-utils",
"./packages/bloom",
"./packages/json",
"./packages/search",
"./packages/time-series",
"./packages/entraid",
"./packages/redis"
],
"scripts": {
"test-single": "TS_NODE_PROJECT='./packages/test-utils/tsconfig.json' mocha --require ts-node/register/transpile-only ",
"test": "npm run test -ws --if-present",
"build": "tsc --build",
"documentation": "typedoc --out ./documentation",
"gh-pages": "gh-pages -d ./documentation -e ./documentation -u 'documentation-bot <documentation@bot>'"
"gh-pages": "gh-pages -d ./documentation -e ./documentation -u 'documentation-bot <documentation@bot>'",
"release": "npm run release --workspaces --if-present --"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@release-it/bumper": "^7.0.5",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.16",
"gh-pages": "^6.1.1",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"release-it": "^17.0.3",
"release-it": "^19.0.2",
"ts-node": "^10.9.2",
"tsx": "^4.7.0",
"typedoc": "^0.25.7",
"typescript": "^5.3.3",
"ts-node": "^10.9.2"
"typescript": "^5.3.3"
}
}

View File

@@ -1,11 +1,22 @@
{
"npm": {
"publish": true,
"publishArgs": ["--access", "public"]
},
"git": {
"tagName": "bloom@${version}",
"tagMatch": "bloom@*",
"commitMessage": "Release ${tagName}",
"tagAnnotation": "Release ${tagName}"
"tagAnnotation": "Release ${tagName}",
"commitArgs": "--all"
},
"npm": {
"versionArgs": ["--workspaces-update=false"],
"publishArgs": ["--access", "public"]
"plugins": {
"@release-it/bumper": {
"out": {
"file": "package.json",
"path": ["peerDependencies.@redis/client"],
"versionPrefix": "^"
}
}
}
}

View File

@@ -9,7 +9,8 @@
"!dist/tsconfig.tsbuildinfo"
],
"scripts": {
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'"
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'",
"release": "release-it"
},
"peerDependencies": {
"@redis/client": "^5.1.1"

View File

@@ -1,11 +1,13 @@
{
"npm": {
"publish": true,
"publishArgs": ["--access", "public"]
},
"git": {
"tagName": "client@${version}",
"tagMatch": "client@*",
"commitMessage": "Release ${tagName}",
"tagAnnotation": "Release ${tagName}"
},
"npm": {
"versionArgs": ["--workspaces-update=false"],
"publishArgs": ["--access", "public"]
"tagAnnotation": "Release ${tagName}",
"commitArgs": "--all"
}
}

View File

@@ -9,7 +9,8 @@
"!dist/tsconfig.tsbuildinfo"
],
"scripts": {
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'"
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'",
"release": "release-it"
},
"dependencies": {
"cluster-key-slot": "1.1.2"

View File

@@ -1,11 +1,22 @@
{
"npm": {
"publish": true,
"publishArgs": ["--access", "public"]
},
"git": {
"tagName": "entraid@${version}",
"tagMatch": "entraid@*",
"commitMessage": "Release ${tagName}",
"tagAnnotation": "Release ${tagName}"
"tagAnnotation": "Release ${tagName}",
"commitArgs": "--all"
},
"npm": {
"versionArgs": ["--workspaces-update=false"],
"publishArgs": ["--access", "public"]
"plugins": {
"@release-it/bumper": {
"out": {
"file": "package.json",
"path": ["peerDependencies.@redis/client"],
"versionPrefix": "^"
}
}
}
}

View File

@@ -14,7 +14,8 @@
"start:auth-pkce": "tsx --tsconfig tsconfig.samples.json ./samples/auth-code-pkce/index.ts",
"start:interactive-browser": "tsx --tsconfig tsconfig.samples.json ./samples/interactive-browser/index.ts",
"test-integration": "mocha -r tsx --tsconfig tsconfig.integration-tests.json './integration-tests/**/*.spec.ts'",
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'"
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'",
"release": "release-it"
},
"dependencies": {
"@azure/identity": "^4.7.0",

View File

@@ -1,11 +1,22 @@
{
"npm": {
"publish": true,
"publishArgs": ["--access", "public"]
},
"git": {
"tagName": "json@${version}",
"tagMatch": "json@*",
"commitMessage": "Release ${tagName}",
"tagAnnotation": "Release ${tagName}"
"tagAnnotation": "Release ${tagName}",
"commitArgs": "--all"
},
"npm": {
"versionArgs": ["--workspaces-update=false"],
"publishArgs": ["--access", "public"]
"plugins": {
"@release-it/bumper": {
"out": {
"file": "package.json",
"path": ["peerDependencies.@redis/client"],
"versionPrefix": "^"
}
}
}
}

View File

@@ -9,7 +9,8 @@
"!dist/tsconfig.tsbuildinfo"
],
"scripts": {
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'"
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'",
"release": "release-it"
},
"peerDependencies": {
"@redis/client": "^5.1.1"

View File

@@ -1,7 +1,27 @@
{
"npm": {
"publish": true,
"publishArgs": ["--access", "public"]
},
"git": {
"tagName": "redis@${version}",
"tagMatch": "redis@*",
"commitMessage": "Release ${tagName}",
"tagAnnotation": "Release ${tagName}"
"tagAnnotation": "Release ${tagName}",
"commitArgs": "--all"
},
"plugins": {
"@release-it/bumper": {
"out": {
"file": "package.json",
"path": [
"dependencies.@redis/client",
"dependencies.@redis/bloom",
"dependencies.@redis/json",
"dependencies.@redis/search",
"dependencies.@redis/time-series"
]
}
}
}
}

View File

@@ -9,6 +9,9 @@
"dist/",
"!dist/tsconfig.tsbuildinfo"
],
"scripts": {
"release": "release-it"
},
"dependencies": {
"@redis/bloom": "5.1.1",
"@redis/client": "5.1.1",

View File

@@ -1,11 +1,22 @@
{
"npm": {
"publish": true,
"publishArgs": ["--access", "public"]
},
"git": {
"tagName": "search@${version}",
"tagMatch": "search@*",
"commitMessage": "Release ${tagName}",
"tagAnnotation": "Release ${tagName}"
"tagAnnotation": "Release ${tagName}",
"commitArgs": "--all"
},
"npm": {
"versionArgs": ["--workspaces-update=false"],
"publishArgs": ["--access", "public"]
"plugins": {
"@release-it/bumper": {
"out": {
"file": "package.json",
"path": ["peerDependencies.@redis/client"],
"versionPrefix": "^"
}
}
}
}

View File

@@ -10,7 +10,8 @@
],
"scripts": {
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'",
"test-sourcemap": "mocha -r ts-node/register/transpile-only './lib/**/*.spec.ts'"
"test-sourcemap": "mocha -r ts-node/register/transpile-only './lib/**/*.spec.ts'",
"release": "release-it"
},
"peerDependencies": {
"@redis/client": "^5.1.1"

View File

@@ -1,11 +1,22 @@
{
"npm": {
"publish": true,
"publishArgs": ["--access", "public"]
},
"git": {
"tagName": "time-series@${version}",
"tagMatch": "time-series@*",
"commitMessage": "Release ${tagName}",
"tagAnnotation": "Release ${tagName}"
"tagAnnotation": "Release ${tagName}",
"commitArgs": "--all"
},
"npm": {
"versionArgs": ["--workspaces-update=false"],
"publishArgs": ["--access", "public"]
"plugins": {
"@release-it/bumper": {
"out": {
"file": "package.json",
"path": ["peerDependencies.@redis/client"],
"versionPrefix": "^"
}
}
}
}

View File

@@ -9,7 +9,8 @@
"!dist/tsconfig.tsbuildinfo"
],
"scripts": {
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'"
"test": "nyc -r text-summary -r lcov mocha -r tsx './lib/**/*.spec.ts'",
"release": "release-it"
},
"peerDependencies": {
"@redis/client": "^5.1.1"