Skip to content

Commit

Permalink
chore: try fix dev publish
Browse files Browse the repository at this point in the history
  • Loading branch information
bigopon committed Apr 25, 2022
1 parent a19ed3a commit 23d93cc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 16 deletions.
40 changes: 29 additions & 11 deletions .circleci/config.yml
Expand Up @@ -69,6 +69,12 @@ executors:
docker:
- image: "cimg/node:<< parameters.node >>-browsers"

docker-release:
working_directory: *working_dir
resource_class: large
docker:
- image: "cimg/node:16.14.2"

docker-circleci-bench:
working_directory: *working_dir
resource_class: large
Expand All @@ -81,8 +87,15 @@ executors:
commands:

checkout_install:
parameters:
install_drivers:
type: boolean
default: true
steps:
- browser-tools/install-browser-tools
- when:
condition: <<parameters.install_drivers>>
steps:
- browser-tools/install-browser-tools
- checkout
- run: echo 'export PREFERRED_WORKSPACE_MANAGER=yarn' >> $BASH_ENV
- run: npm ci
Expand Down Expand Up @@ -261,7 +274,7 @@ jobs:
- run: npm run lint:other:ci

merge_and_dist:
executor: docker-circleci
executor: docker-release
parameters:
from:
type: string
Expand All @@ -285,7 +298,8 @@ jobs:
- run: git config --global user.email "aurelia@bluespire.com"
- run: git config --global user.name "AureliaEffect"
- run: git config --global core.mergeoptions "--no-edit"
- checkout_install
- checkout_install:
install_drivers: false
- run: set -o pipefail && npm run build:release
# - run: set -o pipefail && npm run change-tsconfigs:invert
# - run: set -o pipefail && npm run build:release
Expand All @@ -307,7 +321,7 @@ jobs:
destination: << parameters.dist_file_name >>.zip

publish_npm:
executor: docker-circleci
executor: docker-release
parameters:
channel:
type: string
Expand All @@ -318,17 +332,20 @@ jobs:
default: false
steps:
- checkout
- run: sudo npm i -g ts-node@10 @types/node@14
- when:
condition: << parameters.swap >>
steps:
- run: git checkout << parameters.branch >>
- run: git pull
- run: zip -r publish_npm_<< parameters.channel>>.zip packages/*/dist packages/*/package.json
- store_artifacts:
path: publish_npm_<< parameters.channel>>.zip
destination: publish_npm_<< parameters.channel>>.zip
- run:
name: "Authenticate with registry"
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: |
npm ci
npm run publish:<< parameters.channel >>
- run: npm run publish:<< parameters.channel >>

# Standalone playwright test jobs
e2e_playwright:
Expand Down Expand Up @@ -532,7 +549,7 @@ workflows:
npm_command: "test-node"
requires:
- check_doc_abort
#- unit_test:
#- unit_test_aot:
# <<: *filter_ignore_develop_release
# name: test_test262
# npm_command: "test-262"
Expand All @@ -558,18 +575,17 @@ workflows:
path: "examples/jit-webpack-conventions-ts"
requires:
- check_doc_abort
# - lint_packages # not a real requirement but forces long-running jobs to go first
- e2e_playwright:
<<: *filter_ignore_develop_release
name: jit-webpack-vanilla-ts
path: "examples/jit-webpack-vanilla-ts"
requires:
- check_doc_abort
# - lint_packages # not a real requirement but forces long-running jobs to go first
- merge_and_dist:
<<: *filter_only_master
name: merge_and_dist_master
requires:
- check_doc_abort
- unit_test_esm_chrome
- unit_test_esm_firefox
- unit_test_esm_node
Expand All @@ -594,6 +610,7 @@ workflows:
dist_file_name: merge_and_dist_topic
- publish_npm:
<<: *filter_only_master
name: "publish_npm_dev"
channel: dev
branch: develop
swap: true
Expand All @@ -619,7 +636,7 @@ workflows:
- unit_test_cjs:
<<: *filter_only_tag
npm_command: "test-node"
#- unit_test:
#- unit_test_aot:
# <<: *filter_only_tag
# name: test_test262
# npm_command: "test-262"
Expand Down Expand Up @@ -653,6 +670,7 @@ workflows:
type: approval
- publish_npm:
<<: *filter_only_release
name: "publish_npm_latest"
channel: latest
branch: release
requires:
Expand Down
7 changes: 3 additions & 4 deletions package.json
Expand Up @@ -72,7 +72,6 @@
"clean:tsconfig-build-cache": "rimraf packages/*/dist/tsconfig.tsbuildinfo packages-cjs/*/dist/tsconfig.tsbuildinfo",
"clean:lint": "rimraf .eslintcache packages/*/.eslintcache packages-cjs/*/.eslintcache",
"lint": "npm run lint:packages && npm run lint:other",
"lint1": "eslint --ext .ts --quiet --report-unused-disable-directives packages",
"lint:other": "eslint --cache --ext .js,.ts scripts",
"lint:other:ci": "eslint --cache --ext .js,.ts --quiet --report-unused-disable-directives scripts",
"lint:packages": "lage run lint",
Expand All @@ -83,9 +82,9 @@
"change-tsconfigs:restore": "ts-node -P tsconfig.json scripts/change-tsconfigs.ts restore",
"prepare-release": "ts-node -P tsconfig.json scripts/prepare-release.ts",
"generate-native-modules": "ts-node -P tsconfig.json scripts/generate-native-modules.ts",
"publish:dev": "ts-node scripts/publish.ts dev",
"publish:latest": "ts-node scripts/publish.ts latest",
"bump-version:dev": "ts-node -P tsconfig.json scripts/bump-version.ts dev",
"publish:dev": "ts-node scripts/publish.ts dev --esm",
"publish:latest": "npx ts-node scripts/publish.ts latest --esm",
"bump-version:dev": "npx ts-node -P tsconfig.json scripts/bump-version.ts dev",
"bump-version:latest": "ts-node -P tsconfig.json scripts/bump-version.ts latest",
"check-dependencies": "ts-node -P tsconfig.json scripts/check-dependencies.ts",
"pregenerate-tests:template-compiler.static": "tsc --resolveJsonModule --module commonjs --moduleResolution node --outDir scripts/dist scripts/generate-tests/template-compiler.static.ts",
Expand Down
4 changes: 3 additions & 1 deletion scripts/publish.js
Expand Up @@ -8,8 +8,10 @@ const package_json_1 = require("./package.json");
const project_1 = __importDefault(require("./project"));
const child_process_1 = require("child_process");
const path_1 = require("path");
const [, , channel /* dev or latest */] = process.argv;
console.log('Publishing: ' + channel);

(async function () {
const [, , channel /* dev or latest */] = process.argv;
for (const { name, folder } of project_1.default.packages
.filter(p => !p.name.kebab.includes('_')
&& p.folder.includes('packages'))) {
Expand Down
2 changes: 2 additions & 0 deletions scripts/publish.ts
Expand Up @@ -6,6 +6,8 @@ import { join } from 'path';
(async function (): Promise<void> {
const [, , channel/* dev or latest */] = process.argv;

console.log(`Publishing for channel: ${channel}`);

for (const { name, folder }
of project.packages
.filter(
Expand Down

0 comments on commit 23d93cc

Please sign in to comment.