Skip to content
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
11 changes: 7 additions & 4 deletions .github/actions/eslint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ description: Run ESLint check
runs:
using: 'composite'
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22
cache: 'npm'
node-version: 24
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
shell: bash

- name: ESLint check
run: npx eslint packages/*/src
run: pnpm exec eslint packages/*/src
shell: bash
11 changes: 7 additions & 4 deletions .github/actions/licenses/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ description: Run licenses check
runs:
using: 'composite'
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22
cache: 'npm'
node-version: 24
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
shell: bash

- name: Build packages
run: npm run build:packages
run: pnpm run build:packages
shell: bash

- name: Licenses check
Expand Down
13 changes: 8 additions & 5 deletions .github/actions/unit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ description: Run unit tests
runs:
using: 'composite'
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22
cache: 'npm'
node-version: 24
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
shell: bash

- name: Build packages
run: npm run build:packages
run: pnpm run build:packages
shell: bash

- name: Unit tests
run: npm run test:unit
run: pnpm run test:unit
shell: bash
27 changes: 17 additions & 10 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
force:
description: 'Use "--force" flag for npm'
description: 'Ignore lockfile mismatch (pnpm install --no-frozen-lockfile)'
required: false
default: 'false'

Expand All @@ -19,27 +19,34 @@ jobs:
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22
cache: 'npm'
node-version: 24
cache: 'pnpm'

- name: Publish preview
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
INSTALL_FLAGS="--frozen-lockfile"
if [[ "${{ inputs.force }}" == "true" ]]; then
NPM_FLAGS="--force"
NPM_CLIENT_ARGS="--npm-client-args=--force"
echo "Force installing is enabled"
# pnpm-аналог прежнего npm --force: единственное, что имеет смысл
# ослабить при ручном запуске — сверку локфайла. Сам --force у pnpm
# означает пересоздание локфайла и с --frozen-lockfile несовместим.
INSTALL_FLAGS="--no-frozen-lockfile"
echo "Lockfile check is disabled"
fi
git config --global user.email "[email protected]"
git config --global user.name "cloud-ru-tech-robot"
npm config --global set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm ci $NPM_FLAGS
pnpm install $INSTALL_FLAGS
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
npx lerna version prerelease --yes --exact --no-push --no-commit-hooks --preid "preview-$SHORT_SHA" ${NPM_CLIENT_ARGS}
npm run build:packages $NPM_FLAGS
npx lerna publish from-git --yes --dist-tag preview
pnpm exec lerna version prerelease --yes --exact --no-push --no-commit-hooks --preid "preview-$SHORT_SHA"
pnpm run build:packages
# catalog: разворачивает корневой prepack — см. комментарий в release.yml
pnpm exec lerna publish from-git --yes --dist-tag preview
shell: bash
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22
cache: 'npm'
node-version: 24
cache: 'pnpm'

- name: Publish latest
env:
Expand All @@ -57,11 +60,15 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "cloud-ru-tech-robot"
npm config --global set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm ci
pnpm install --frozen-lockfile
if [[ ! $CI_LERNA_SKIP ]] ; then
isNewVersionDetected=$(npx @cloud-ru/ft-lerna-changelog-generator@latest)
if [[ "$isNewVersionDetected" != "false" ]] ; then
npm run build:packages && npx lerna publish from-git --yes
pnpm run build:packages
# catalog: разворачивает корневой prepack — lerna прогоняет lifecycle
# корневого манифеста перед упаковкой пакетов, поэтому отдельных шагов
# и выбрасываемого коммита здесь не нужно.
pnpm exec lerna publish from-git --yes
fi
fi
shell: bash
3 changes: 1 addition & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
save-exact=true
registry=https://registry.npmjs.org/
registry=https://registry.npmjs.org/
22 changes: 18 additions & 4 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
{
"version": "independent",
"npmClient": "pnpm",
"packages": [
"packages/*"
],
"command": {
"publish": {
"ignoreChanges": ["ignored-file", "*.md"],
"ignoreChanges": [
"ignored-file",
"*.md"
],
"message": "[ci skip] Version bump",
"registry": "https://registry.npmjs.org"
},
"version": {
"changelogPreset": "@cloud-ru/ft-conventional-changelog-old",
"ignoreChanges": ["**/*.md", "**/*.MD", "**/*.mdx", "**/*.MDX", "./scripts/**/*", "packages/*/__tests__/**/*.*"]
"changelogPreset": "@cloud-ru/ft-conventional-changelog",
"ignoreChanges": [
"**/*.md",
"**/*.MD",
"**/*.mdx",
"**/*.MDX",
"./scripts/**/*",
"packages/*/__tests__/**/*.*"
]
},
"create": {
"license": "Apache-2.0"
}
},
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
"$schema": "https://raw.githubusercontent.com/lerna/lerna/main/packages/lerna/schemas/lerna-schema.json"
}
Loading
Loading