-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
2,693 additions
and
129 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = function processingData() { | ||
const arr = [ | ||
'plasma-web', | ||
'plasma-ASDK', | ||
'plasma-b2c', | ||
'caldera', | ||
].map((i) => `@salutejs/${i}`); | ||
|
||
return { | ||
"PACKAGES": JSON.stringify(arr) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const getPackagesShortName = (list = [], dict) => { | ||
return list | ||
.filter((item) => dict.includes(item)) | ||
.map((item) => { | ||
return item.replace('@salutejs/', '').replace('plasma-', ''); | ||
}) | ||
} | ||
|
||
module.exports = () => { | ||
const { PACKAGES_STORYBOOK, OUTPUT, PR_NAME = "pr-1021" } = process.env; | ||
|
||
const packagesStorybook= JSON.parse(PACKAGES_STORYBOOK); | ||
const output= JSON.parse(OUTPUT); | ||
|
||
const links = [ | ||
`website: http://plasma.sberdevices.ru/pr/pr-${PR_NAME}/`, | ||
]; | ||
|
||
getPackagesShortName(output, packagesStorybook).forEach((packageName) => { | ||
links.push(`${packageName} storybook: http://plasma.sberdevices.ru/pr/pr-${PR_NAME}/${packageName}-storybook/`); | ||
}); | ||
|
||
const message = `Documentation preview deployed! | ||
${links.join('\n')} | ||
`; | ||
|
||
console.log(message); | ||
|
||
return message; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"categories": [ | ||
{ | ||
"title": "## Components", | ||
"labels": ["components"] | ||
}, | ||
{ | ||
"title": "## Icons", | ||
"labels": ["plasma-icons"] | ||
}, | ||
{ | ||
"title": "## Uncategorized", | ||
"labels": [] | ||
} | ||
], | ||
"ignore_labels": ["skip"], | ||
"pr_template": "#{{DESC}}\n#{{TITLE}} (#{{URL}})\n", | ||
"custom_placeholders": [ | ||
{ | ||
"name": "DESC", | ||
"source": "BODY", | ||
"transformer": { | ||
"pattern": "(?:\n### What\/why changed)(.*)", | ||
"flags": "s", | ||
"target": " " | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Create release PR | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-notes: | ||
name: Build Changelog | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
fetch-depth: 0 | ||
|
||
- name: Computed envs | ||
run: | | ||
echo "DATE=$(date +'%d.%m.%Y')" >> $GITHUB_ENV | ||
echo "FROM_TAG=$(git merge-base --fork-point origin/main)" >> $GITHUB_ENV | ||
echo "FILE_PATH=${{ github.workspace }}/changelog_artifacts.md" >> $GITHUB_ENV | ||
- name: Build Changelog | ||
id: github_release | ||
uses: mikepenz/[email protected] | ||
with: | ||
fromTag: ${{ env.FROM_TAG }} | ||
toTag: ${{ github.sha }} | ||
configuration: "./.github/workflows/changelog-builder-config.json" | ||
|
||
- name: Create "changelog_artifacts.md" | ||
run: | | ||
cat > ${{ env.FILE_PATH }} <<'EOF' | ||
${{ steps.github_release.outputs.changelog }} | ||
- name: Upload "changelog_artifacts.md" | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: release-changelog-artifacts | ||
path: ${{ env.FILE_PATH }} | ||
|
||
- name: Create release PR | ||
run: | | ||
changelog='${{ steps.github_release.outputs.changelog }}' | ||
gh pr create --base main --head ${{ github.ref_name }} --title "Release by ${{ env.DATE }}" --body "# Release Notes | ||
$changelog" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Release | ||
|
||
on: | ||
merge_group: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
|
||
- name: One | ||
id: pr_state | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
console.log(context); | ||
console.log(context.repo.owner); | ||
console.log(context.repo.repo); | ||
const teammate = { | ||
Yakutoc: "alex_czech", | ||
'neretin-trike': "aaneretin", | ||
'Yeti-or': "yeti-or", | ||
TitanKuzmich: "aakrivonos", | ||
kayman233: "ivakudryavtsev", | ||
}; | ||
const res = await github.rest.repos.listPullRequestsAssociatedWithCommit({ | ||
commit_sha: context.payload.merge_group.head_sha, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}); | ||
console.log(res); | ||
const { title, user: { login = "alex_czech" } } = res?.data[0] || {}; | ||
return { pr: title, user: teammate[login] || 'alex_czech' }; | ||
- name: Create the Mattermost Message | ||
if: ${{ success() }} | ||
run: | | ||
title=${{ fromJSON(steps.pr_state.outputs.result).pr }} | ||
user=${{ fromJSON(steps.pr_state.outputs.result).user }} | ||
echo "{\"text\":\"$title - In progress\\n@user\"}" > mattermost.json | ||
- name: Send notification | ||
uses: mattermost/action-mattermost-notify@master | ||
env: | ||
MATTERMOST_WEBHOOK_URL: ${{ secrets.WEBHOOKS_NOTIFICATIONS_MM }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ jobs: | |
secrets: | ||
gh_token: ${{ secrets.GH_TOKEN }} | ||
npm_registry_token: ${{ secrets.NPM_REGISTRY_TOKEN }} | ||
|
Oops, something went wrong.