Skip to content

Commit

Permalink
Setup publishing storybook to Chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypnosphi committed Dec 20, 2024
1 parent 8e7a9e6 commit 14ee31d
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 93 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ yarn-error.log
yarn.lock
/metadata-messages.json
npm-audit.html
build-storybook.log

# Secrets
.env
25 changes: 0 additions & 25 deletions .teamcity/patches/buildTypes/Publish.kts

This file was deleted.

30 changes: 0 additions & 30 deletions .teamcity/patches/buildTypes/PublishNext.kts

This file was deleted.

32 changes: 0 additions & 32 deletions .teamcity/patches/buildTypes/PublishToGitHubPages.kts

This file was deleted.

20 changes: 18 additions & 2 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,14 @@ object Publish : BuildType({
}

triggers {
vcs {
id = "vcsTrigger"
triggerRules = """
-:user=npmjs-buildserver:**
+:comment=(?i)\[publish\]:**
""".trimIndent()
branchFilter = "+:master"
}
retryBuild {
id = "retryBuildTrigger"
delaySeconds = 60
Expand Down Expand Up @@ -1017,7 +1025,7 @@ object PublishHotfixRelease : BuildType({
object PublishNext : BuildType({
templates(AbsoluteId("JetBrainsUi_LernaPublish"))
name = "Publish @next"
paused = true
paused = false

artifactRules = """
%teamcity.build.workingDir%/npmlogs/*.log=>npmlogs
Expand Down Expand Up @@ -1123,7 +1131,12 @@ object PublishNext : BuildType({

triggers {
vcs {
enabled = false
id = "vcsTrigger"
triggerRules = """
-:user=npmjs-buildserver:**
+:comment=(?i)\[publish\]:**
""".trimIndent()
branchFilter = "-:<default>"
}
retryBuild {
enabled = false
Expand Down Expand Up @@ -1201,12 +1214,14 @@ object PublishToGitHubPages : BuildType({
param("org.jfrog.artifactory.selectedDeployableServer.downloadSpecSource", "Job configuration")
param("org.jfrog.artifactory.selectedDeployableServer.useSpecs", "false")
param("org.jfrog.artifactory.selectedDeployableServer.uploadSpecSource", "Job configuration")
password("env.CHROMATIC_PROJECT_TOKEN", "credentialsJSON:14b73cdb-03e5-4b8f-b8c1-77d370951b9f")
}

vcs {
root(DslContext.settingsRoot)
branchFilter = """
+:master
+:<default>
+:release-*
""".trimIndent()
}
Expand Down Expand Up @@ -1237,6 +1252,7 @@ object PublishToGitHubPages : BuildType({
git config user.name "%github.com.builduser.name%"
npx gh-pages --dist storybook-dist --dest %teamcity.build.branch% --message "Deploy %teamcity.build.branch%" --nojekyll
npm run chromatic
""".trimIndent()
dockerImage = "node:20"
dockerRunParameters = "-v %teamcity.build.workingDir%/npmlogs:/root/.npm/_logs"
Expand Down
76 changes: 76 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"name": "@jetbrains/ring-ui",
"version": "7.0.16",
"description": "JetBrains UI library",
"author": "JetBrains",
"author": {
"name": "JetBrains"
},
"license": "Apache-2.0",
"packageManager": "[email protected]",
"files": [
Expand Down Expand Up @@ -46,6 +48,8 @@
"screenshots-test-ci": "npm --prefix packages/screenshots run test-ci",
"screenshots-gather": "npm --prefix packages/screenshots run gather",
"build-stories": "storybook build --quiet -c .storybook -o storybook-dist",
"chromatic": "npx chromatic --build-script-name build-stories --exit-once-uploaded",
"chromatic-local": "dotenv -- npm run publish-stories",
"prebuild": "rimraf components && tsc --project tsconfig-build.json && cpy './**/*' '!**/*.ts' '!**/*.tsx' '!**/__mocks__/**' ../components --parents --cwd=src/",
"build": "./node_modules/.bin/rollup -c --bundleConfigAsCjs",
"postbuild": "cpy './**/*.d.ts' ../dist --parents --cwd=components/",
Expand Down Expand Up @@ -73,7 +77,7 @@
},
"repository": {
"type": "git",
"url": "ssh://github.com/JetBrains/ring-ui.git"
"url": "git+ssh://git@github.com/JetBrains/ring-ui.git"
},
"readmeFilename": "README.md",
"devDependencies": {
Expand All @@ -87,8 +91,8 @@
"@eslint/js": "^9.17.0",
"@jetbrains/eslint-config": "^6.0.4",
"@jetbrains/logos": "3.0.0-canary.734b213.0",
"@jetbrains/stylelint-config": "^4.0.2",
"@jetbrains/rollup-css-plugin": "./packages/rollup-css-plugin",
"@jetbrains/stylelint-config": "^4.0.2",
"@primer/octicons": "^19.14.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-json": "^6.1.0",
Expand Down Expand Up @@ -133,8 +137,10 @@
"chai-dom": "^1.10.0",
"chai-enzyme": "1.0.0-beta.1",
"cheerio": "^1.0.0-rc.12",
"chromatic": "^11.20.2",
"core-js": "^3.39.0",
"cpy-cli": "^5.0.0",
"dotenv-cli": "^7.4.4",
"enzyme": "^3.11.0",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
Expand Down Expand Up @@ -254,5 +260,9 @@
"engines": {
"node": ">=14.0",
"npm": ">=6.0.0"
}
},
"bugs": {
"url": "https://github.com/JetBrains/ring-ui/issues"
},
"homepage": "https://github.com/JetBrains/ring-ui#readme"
}

0 comments on commit 14ee31d

Please sign in to comment.