Skip to content

Commit

Permalink
Release by 10.04.2024 (#1175)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakutoc authored Apr 11, 2024
2 parents bfcf7d3 + 0937788 commit 34d0a2b
Show file tree
Hide file tree
Showing 579 changed files with 365,178 additions and 80,457 deletions.
1 change: 0 additions & 1 deletion .github/config-ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"plasma-ui",
"plasma-new-hope",
"plasma-asdk",
"caldera",
"caldera-online",
"sdds-serv"
]
Expand Down
38 changes: 38 additions & 0 deletions .github/get-lerna-scope.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const META = require('./meta');

module.exports = () => {
const { PACKAGE, PROCESSED_DATA } = process.env;

// INFO: результат команды `lerna la --since` - список пакетов в которых были изменения
// или они связаны в графе зависимостей lerna
const processedData = JSON.parse(PROCESSED_DATA);

// INFO: Список пакетов которые нужно поставить если они есть в списке processedData
const packageScope = META[PACKAGE].scope || [];
const packageTheme = META[PACKAGE].themes;

// INFO: Список обязательных пакетов без которых не будет работать сборка
// INFO: Например для корректной сборки storybook в `plasma-asdk` нужно ставить plasma-core
// INFO: Это workaround - временно позволяет обойти ошибки в инфре
const requiredDeps = META[PACKAGE].required || [];

// INFO: Пакет с документацией, например `plasma-web-docs` или `sdds-serv-docs`
const packageDocs = `${PACKAGE}-docs`;

const computedScope = processedData.filter((dep) => [...packageScope, packageDocs].includes(dep));

const scope = new Set([...computedScope, ...requiredDeps, PACKAGE]);

if (scope.has(packageDocs)) {
scope.add('plasma-docs-ui');
}

if (scope.has(packageTheme)) {
scope.add('data-themes');
scope.add('plasma-typo');
}

const scopeList = Array.from(scope);

return scopeList.length === 1 ? `@salutejs/${scopeList[0]}` : `@salutejs/{${scopeList.join(',')}}`;
};
54 changes: 54 additions & 0 deletions .github/meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const commonScope = ['plasma-icons', 'plasma-sb-utils', 'plasma-tokens', 'plasma-tokens-utils'];

module.exports = {
'caldera-online': {
scope: [...commonScope, 'caldera-online-themes', 'plasma-new-hope'],
themes: 'caldera-online-themes',
},
'plasma-asdk': {
scope: [...commonScope, 'plasma-tokens-b2b', 'plasma-typo', 'plasma-themes', 'plasma-new-hope'],
required: ['plasma-core'],
themes: 'plasma-themes',
},
'plasma-b2c': {
scope: [
...commonScope,
'plasma-core',
'plasma-hope',
'plasma-new-hope',
'plasma-tokens-b2c',
'plasma-tokens-web',
'plasma-typo',
],
required: ['plasma-new-hope'],
themes: '',
},
'plasma-new-hope': {
scope: [...commonScope, 'plasma-core'],
required: [],
},
'plasma-ui': {
scope: [...commonScope, 'plasma-core', 'plasma-typo'],
required: ['plasma-icons'],
themes: '',
},
'plasma-web': {
scope: [
...commonScope,
'plasma-core',
'plasma-hope',
'plasma-new-hope',
'plasma-tokens-b2c',
'plasma-tokens-b2b',
'plasma-tokens-web',
'plasma-typo',
],
required: ['plasma-new-hope'],
themes: '',
},
'sdds-serv': {
scope: [...commonScope, 'sdds-themes', 'plasma-new-hope'],
required: [],
themes: 'sdds-themes',
},
};
20 changes: 17 additions & 3 deletions .github/workflows/dispatch-custom-event.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
version:
description: 'Version plasma-icons package'
required: true
repo:
description: 'Repo target'
required: true
default: 'plasma-android'
release:
types: [published]

Expand All @@ -27,7 +31,7 @@ jobs:
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/salute-developers/plasma-android/dispatches \
https://api.github.com/repos/salute-developers/${{ github.event.inputs.repo }}/dispatches \
-d "{\"event_type\":\"build-icons\",\"client_payload\":{\"version\":\"${{github.event.inputs.version}}\", \"ref\": \"${{github.event.inputs.ref}}\"}}"
dispatch-published:
Expand All @@ -37,9 +41,9 @@ jobs:
steps:
- name: Get package version
run: |
echo "VERSION=$(echo "${{ github.event.release.tag_name }}" | cut -d '@' -f 2)" >> "$GITHUB_ENV"
echo "VERSION=$(echo "${{ github.event.release.tag_name }}" | cut -d '@' -f 3)" >> "$GITHUB_ENV"
- name: Dispatch custom event
- name: Dispatch custom event to android
run: |
curl -L \
-X POST \
Expand All @@ -48,3 +52,13 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/salute-developers/plasma-android/dispatches \
-d "{\"event_type\":\"build-icons\",\"client_payload\":{\"version\":\"$VERSION\", \"ref\": \"master\"}}"
- name: Dispatch custom event to iOS
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/salute-developers/plasma-ios/dispatches \
-d "{\"event_type\":\"build-icons\",\"client_payload\":{\"version\":\"$VERSION\", \"ref\": \"master\"}}"
55 changes: 5 additions & 50 deletions .github/workflows/documentation-deploy-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ jobs:
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build/${PR_NAME}/
Expand Down Expand Up @@ -134,7 +133,7 @@ jobs:

- name: Set job environment variables
run: |
echo "SHORT_NAME=$(echo ${{ matrix.package }} | sed -r 's/@salutejs\///g' | sed -r 's/plasma-//g')" >> $GITHUB_ENV
echo "SHORT_NAME=$(echo ${{ matrix.package }} | sed -r 's/plasma-//g')" >> $GITHUB_ENV
echo "HAS_PACKAGE_DOCS=$([ -d "./website/${{ matrix.package }}-docs" ] && echo true || echo false)" >> $GITHUB_ENV
- name: Get lerna scope
Expand All @@ -146,54 +145,9 @@ jobs:
with:
result-encoding: string
script: |
const { PROCESSED_DATA, PACKAGE } = process.env;
const processedData = JSON.parse(PROCESSED_DATA);
const [scopeDSName] = PACKAGE.split('-');
// INFO: Пока нет устойчивого правила для формирования пакетов `themes`
// и где то используется одно слово, типа `plasma`, а где-то два `caldera-online`
const themes = ['caldera-online'].includes(PACKAGE) ? `${PACKAGE}-themes` : `${scopeDSName}-themes`;
const packages = [
'plasma-hope',
'plasma-new-hope',
'plasma-tokens',
'plasma-tokens-native',
'plasma-tokens-utils',
'plasma-typo',
themes,
`${PACKAGE}-docs`,
];
// TODO: рефакторинг - использовать объект для resolve required deps
const result = [
...processedData.filter((package) => packages.includes(package)),
PACKAGE,
'plasma-core',
'plasma-docs-ui',
'plasma-icons',
];
// INFO: Пока не починили медленный css build for b2c/web ставим plasma-new-hope
if (processedData.includes('plasma-b2c') || processedData.includes('plasma-web')) {
result.push('plasma-new-hope');
}
if (result.includes('plasma-tokens-native')) {
result.push('plasma-tokens');
result.push('plasma-tokens-utils');
}
if (result.includes(themes)) {
result.push('plasma-typo');
result.push('data-themes');
}
console.log('Result =>', result);
return `@salutejs/{${result.join(',')}}`;
const getLernaScope = require('./.github/get-lerna-scope.js');
return getLernaScope();
- name: Lerna bootstrap
run: npx lerna bootstrap --scope="${{ steps.lerna-scope.outputs.result }}"
Expand Down Expand Up @@ -253,6 +207,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: refs/pull/${{github.event.pull_request.number}}/merge
show-progress: false

- name: Create comment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy documentation and storybook artefacts to "/dev"
name: Deploy documentation artefacts to "demo" stage [dev branch]

on:
workflow_dispatch:
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/documentation-deploy-stage-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ jobs:
npm run storybook:build --prefix="./packages/plasma-new-hope"
cp -R ./packages/plasma-new-hope/build-sb ./s3_build_sb/new-hope-storybook
- name: Plasma "Caldera" Storybook
run: |
npm run storybook:build --prefix="./packages/caldera"
cp -R ./packages/caldera/build-sb ./s3_build_sb/caldera-storybook
- name: Plasma "Caldera-online" Storybook
run: |
npm run storybook:build --prefix="./packages/caldera-online"
Expand Down Expand Up @@ -178,21 +173,6 @@ jobs:
./s3_build_sb/new-hope-storybook/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/new-hope-storybook/
- name: Upload to S3 storybook "Caldera"
run: >
s3cmd
--access_key ${{ secrets.AWS_ACCESS_KEY_ID }}
--secret_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
--host ${{ secrets.AWS_ENDPOINT }}
--host-bucket ${{ secrets.AWS_ENDPOINT }}
--bucket-location ${{ secrets.AWS_REGION }}
--signature-v2
--delete-removed
--no-mime-magic
sync
./s3_build_sb/caldera-storybook/
s3://${{ secrets.AWS_S3_BUCKET_DEV_STAGE }}/caldera-storybook/
- name: Upload to S3 storybook "Caldera-online"
run: >
s3cmd
Expand Down
4 changes: 2 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @Yeti-or @neretin-trike @Yakutoc @kayman233
* @Yeti-or @neretin-trike @Yakutoc @TitanKuzmich @shuga2704

native/* @malilex @Yeti-or

.github/* @Yakutoc @Yeti-or @malilex
.github/* @Yakutoc @Yeti-or @malilex
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
3 changes: 3 additions & 0 deletions packages/caldera-online/api/caldera-online.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ clear: string;
success: string;
warning: string;
critical: string;
dark: string;
black: string;
white: string;
};
size: {
l: string;
Expand Down
Loading

0 comments on commit 34d0a2b

Please sign in to comment.