From dbee368964cbe4cedcfe68bbc47053dfcf3b2cc5 Mon Sep 17 00:00:00 2001 From: Horia Iacos Date: Sun, 8 Feb 2026 20:01:08 +0200 Subject: [PATCH 1/3] chore: Use Github Actions workflows --- .circleci/config.yml | 124 --------------------------------------- .circleci/run-local | 65 -------------------- .github/workflows/ci.yml | 58 ++++++++++++++++++ package.json | 2 +- yarn.lock | 35 +++++++++-- 5 files changed, 89 insertions(+), 195 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100755 .circleci/run-local create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index b078b70156..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,124 +0,0 @@ -version: 2 - -defaults: &defaults - docker: - - image: cimg/node:20.18 - environment: - - NODE_OPTIONS=--max_old_space_size=8192 - resource_class: large - working_directory: ~/repo - -save_src_cache: &save_src_cache - key: source-v1-{{ .Branch }}-{{ .Revision }} - paths: - - ~/repo - -restore_src_cache: &restore_src_cache - keys: - - source-v1-{{ .Branch }}-{{ .Revision }} - - source-v1-{{ .Branch }}- - - source-v1- - -save_yarn_cache: &save_yarn_cache - key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }} - paths: - - node_modules - -restore_yarn_cache: &restore_yarn_cache - keys: - - yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }} - - yarn-packages-v1-{{ .Branch }}- - - yarn-packages-v1- - -reg_auth: ®_auth - name: Authenticate with registry - command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc - -jobs: - lint: - <<: *defaults - steps: - - restore_cache: *restore_src_cache - - checkout - - save_cache: *save_src_cache - - restore_cache: *restore_yarn_cache - - run: yarn install - - save_cache: *save_yarn_cache - - run: scripts/build lint - test: - <<: *defaults - steps: - - restore_cache: *restore_src_cache - - checkout - - save_cache: *save_src_cache - - restore_cache: *restore_yarn_cache - - run: yarn install - - save_cache: *save_yarn_cache - - run: scripts/build babel test - build: - <<: *defaults - steps: - - restore_cache: *restore_src_cache - - checkout - - save_cache: *save_src_cache - - restore_cache: *restore_yarn_cache - - run: yarn install - - save_cache: *save_yarn_cache - - run: *reg_auth - - run: scripts/build release --next --token $NPM_TOKEN - release: - <<: *defaults - steps: - - restore_cache: *restore_src_cache - - checkout - - save_cache: *save_src_cache - - restore_cache: *restore_yarn_cache - - run: yarn install - - save_cache: *save_yarn_cache - - run: *reg_auth - - run: scripts/build release --token $NPM_TOKEN - -workflows: - version: 2 - - simple_build: - jobs: - - lint: - filters: - branches: - ignore: - - develop - - master - - test: - filters: - branches: - ignore: - - develop - - master - build: - jobs: - - build: - context: jira - filters: - branches: - only: - - develop - - release: - jobs: - - release: - context: jira - filters: - branches: - only: - - master - # nightly: - # triggers: - # - schedule: - # cron: "0 0 * * *" - # filters: - # branches: - # only: - # - develop - # jobs: - # - build diff --git a/.circleci/run-local b/.circleci/run-local deleted file mode 100755 index fc48528275..0000000000 --- a/.circleci/run-local +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env node -const { execSync } = require('child_process'); -const chalk = require('chalk'); -const { GITHUB_TOKEN, NPM_TOKEN } = process.env; -const REMOTE_REGEX = /.*?[\t|\s]+git@github.com:(.*)\/(.*)\.git\s+\(.*\)/; -const minimist = require('minimist'); -const { resolve } = require('path'); -const args = minimist(process.argv.slice(2)); - -if (!args.job) { - console.error(chalk.red('no --job flag')); - process.exit(1); -} - -const getGitInfo = () => { - const raw = execSync(`git remote -v`) - .toString() - .trim(); - const rows = raw.split('\n'); - - const m = rows[0].match(REMOTE_REGEX); - console.log(m); - - if (m && m.length > 2) { - const branch = execSync(`git rev-parse --abbrev-ref HEAD`) - .toString() - .trim(); - return { branch, user: m[1], repo: m[2] }; - } - - return {}; -}; - -const info = getGitInfo(); - -console.log('info:', info); - -const vars = { - GITHUB_TOKEN, - NPM_TOKEN, - CIRCLE_PROJECT_REPONAME: info.repo, - CIRCLE_PROJECT_USERNAME: info.user, - CIRCLE_BRANCH: info.branch -}; - -const missingVars = Object.keys(vars).filter(k => !vars[k]); - -if (missingVars.length > 0) { - console.error(chalk.red(`Missing: ${missingVars.join(' ')}`)); - process.exit(1); -} - -const envVarString = Object.keys(vars) - .map(k => `-e ${k}=${vars[k]}`) - .join(' '); -const cmd = `circleci local execute ${envVarString} --job ${args.job}`; -console.log('cmd: ', cmd); - -console.log(chalk.yellow('validating config...')); -execSync('circleci config validate', { stdio: 'inherit' }); - -if (args.dryRun) { - process.exit(); -} -execSync(cmd, { stdio: 'inherit', cwd: resolve(__dirname, '..') }); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..504c674651 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: PIE Elements CI + +on: + push: + branches: + - develop + - master + pull_request: + branches: + - develop + - master + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + - run: yarn install + - run: scripts/build lint + - run: scripts/build babel test + + build-next: + needs: test + if: github.ref == 'refs/heads/develop' && github.event_name == 'push' + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write # REQUIRED for npm trusted publishing + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: https://registry.npmjs.org/ + cache: yarn + - run: yarn install + - run: scripts/build release --next + + build-release: + needs: test + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write # REQUIRED for npm trusted publishing + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: https://registry.npmjs.org/ + cache: yarn + - run: yarn install + - run: scripts/build release diff --git a/package.json b/package.json index 3551f12b82..8593e95bfe 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@babel/preset-env": "^7.28.6", "@babel/preset-react": "^7.28.5", "@pie-framework/build-helper": "^5.2.9", - "@pie-framework/pie-code-health": "git+ssh://git@github.com/pie-framework/pie-code-health.git#main", + "@pie-framework/pie-code-health": "https://github.com/pie-framework/pie-code-health.git#main", "@pie-lib/test-utils": "1.1.1-next.0", "@pslb/pslb": "^4.4.1", "@rollup/plugin-commonjs": "^20.0.0", diff --git a/yarn.lock b/yarn.lock index 9e89b78a0f..ded3f1ccb6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2611,9 +2611,9 @@ unist-util-modify-children "^1.0.0" unist-util-visit-children "^1.0.0" -"@pie-framework/pie-code-health@git+ssh://git@github.com/pie-framework/pie-code-health.git#main": +"@pie-framework/pie-code-health@https://github.com/pie-framework/pie-code-health.git#main": version "1.0.0" - resolved "git+ssh://git@github.com/pie-framework/pie-code-health.git#47fd9453c9702376eae0507f31dbce53acc8f67d" + resolved "https://github.com/pie-framework/pie-code-health.git#47fd9453c9702376eae0507f31dbce53acc8f67d" dependencies: chalk "^5.3.0" commander "^11.1.0" @@ -14727,7 +14727,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -14745,6 +14745,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -14844,7 +14853,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -14865,6 +14874,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.2" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.2.tgz#132875abde678c7ea8d691533f2e7e22bb744dba" @@ -15994,7 +16010,7 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -16020,6 +16036,15 @@ wrap-ansi@^6.0.1: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 8684dc006bb68d78ecd6b1fbfe45d8bcb4c09cf4 Mon Sep 17 00:00:00 2001 From: Horia Iacos Date: Sun, 8 Feb 2026 20:17:39 +0200 Subject: [PATCH 2/3] chore: cleanup --- package.json | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 8593e95bfe..727158fafe 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,7 @@ { + "name": "pie-elements", "private": true, - "browserslist": [ - ">0.5%", - "not dead" - ], + "license": "MIT", "scripts": { "lint": "eslint --ext .js --ext .jsx packages", "test": "scripts/build test", @@ -29,6 +27,10 @@ "health:serve": "pie-health serve", "health:check": "pie-health check packages" }, + "dependencies": { + "core-js": "^3.40.0", + "express": "^4.17.1" + }, "devDependencies": { "@babel/cli": "^7.28.6", "@babel/core": "^7.28.6", @@ -74,16 +76,6 @@ "semver": "^7.3.2", "yarn": "^1.22.22" }, - "workspaces": [ - "packages/*", - "packages/*/configure", - "packages/*/controller", - "packages/*/print" - ], - "dependencies": { - "core-js": "^3.40.0", - "express": "^4.17.1" - }, "resolutions": { "react": "18.3.1", "react-dom": "18.3.1", @@ -122,5 +114,15 @@ "@pie-lib/text-select": "2.1.1-next.0", "@pie-lib/tools": "1.1.1-next.0", "@pie-lib/translator": "3.1.1-next.0" - } + }, + "browserslist": [ + ">0.5%", + "not dead" + ], + "workspaces": [ + "packages/*", + "packages/*/configure", + "packages/*/controller", + "packages/*/print" + ] } From f7a2b9b773c3570babdb59d3efa4f2f7510ae42d Mon Sep 17 00:00:00 2001 From: Horia Iacos Date: Mon, 9 Feb 2026 09:31:36 +0200 Subject: [PATCH 3/3] chore: Read env from secrets --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 504c674651..c94f30cd8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,8 @@ jobs: permissions: contents: read id-token: write # REQUIRED for npm trusted publishing + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -47,6 +49,8 @@ jobs: permissions: contents: read id-token: write # REQUIRED for npm trusted publishing + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4