-
Notifications
You must be signed in to change notification settings - Fork 11
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
13 changed files
with
346 additions
and
545 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,56 +1,63 @@ | ||
# this file still do nothing | ||
version: 2 | ||
|
||
aliases: | ||
- &docker | ||
- image: circleci/node:dubnium | ||
|
||
- &environment | ||
TZ: /usr/share/zoneinfo/America/Los_Angeles | ||
|
||
- &restore_yarn_cache | ||
restore_cache: | ||
name: Restore node_modules cache | ||
keys: | ||
- v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
- v1-node-{{ arch }}-{{ .Branch }}- | ||
- v1-node-{{ arch }}- | ||
- &run_yarn | ||
run: | ||
name: Install Packages | ||
command: yarn --frozen-lockfile | ||
|
||
orbs: | ||
node: circleci/node@1.0.1 | ||
|
||
jobs: | ||
setup: | ||
docker: *docker | ||
environment: *environment | ||
sanity_check: | ||
working_directory: ~/project | ||
docker: | ||
- image: circleci/node:10 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: Restore Yarn Package Cache | ||
keys: | ||
- yarn-packages-{{ checksum "yarn.lock" }} | ||
- run: | ||
name: Install Dependencies | ||
command: yarn install --frozen-lockfile | ||
- save_cache: | ||
name: Save Yarn Package Cache | ||
key: yarn-packages-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ~/.cache/yarn | ||
- run: | ||
name: Run Tests | ||
command: yarn test | ||
|
||
publish_if_needed: | ||
working_directory: ~/project | ||
docker: | ||
- image: circleci/node:10 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: Restore Yarn Package Cache | ||
keys: | ||
- yarn-packages-{{ checksum "yarn.lock" }} | ||
- run: | ||
name: Nodejs Version | ||
command: node --version | ||
- *restore_yarn_cache | ||
- *run_yarn | ||
name: Install Dependencies | ||
command: yarn install --frozen-lockfile | ||
- save_cache: | ||
name: Save node_modules cache | ||
key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
name: Save Yarn Package Cache | ||
key: yarn-packages-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ~/.cache/yarn | ||
- run: | ||
name: Run Tests | ||
command: node auto-publish/index.js | ||
|
||
workflows: | ||
version: 2 | ||
|
||
for_every_push: | ||
jobs: | ||
- sanity_check | ||
|
||
# workflows: | ||
# version: 2 | ||
# nightly: | ||
# triggers: | ||
# - schedule: | ||
# # every 10 minutes | ||
# cron: "*/10 * * * *" | ||
# filters: | ||
# branches: | ||
# only: | ||
# - master | ||
# jobs: | ||
# - should-publish | ||
publish_if_needed: | ||
triggers: | ||
- schedule: | ||
cron: "0,30 * * * *" | ||
filters: | ||
branches: | ||
only: | ||
- publishing-automation | ||
jobs: | ||
- publish_if_needed |
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 @@ | ||
//registry.npmjs.org/:_authToken=${NPM_TOKEN} |
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 @@ | ||
registry "https://registry.npmjs.org" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
const path = require("path"); | ||
const fs = require("fs-extra"); | ||
const { getAndPatchGivenReactDOMVersion } = require("./utils"); | ||
const { getAndPatchGivenReactDOMVersionWithGivenRHLVersion } = require("./utils"); | ||
|
||
(async () => { | ||
const targetDir = await getAndPatchGivenReactDOMVersion(path.resolve(__dirname, "staging-area"), "16.8.6"); | ||
const targetDir = await getAndPatchGivenReactDOMVersionWithGivenRHLVersion(path.resolve(__dirname, "staging-area"), "16.8.6", "4.12.3", "@hot-loader/react-dom"); | ||
await fs.copy(targetDir, path.resolve(__dirname, "../target")) | ||
|
||
console.log("Done!"); | ||
console.log("Done!", { targetDir }); | ||
})(); |
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 |
---|---|---|
@@ -1,3 +1,59 @@ | ||
const path = require("path"); | ||
const fs = require("fs-extra"); | ||
const { | ||
execFile, | ||
doesReactDOMOrHotLoaderHasNewerVersionThanUs, | ||
getAndPatchGivenReactDOMVersionWithGivenRHLVersion | ||
} = require("./utils"); | ||
|
||
// test with https://github.com/verdaccio/verdaccio ??? | ||
|
||
(async () => { | ||
const ourDistTag = "latest"; | ||
|
||
// TODO: cover more dist tags | ||
const answer = await doesReactDOMOrHotLoaderHasNewerVersionThanUs( | ||
"latest", | ||
"latest", | ||
"test-org-bnaya-2", | ||
"_rc" | ||
); | ||
|
||
if (answer) { | ||
console.info("Going to publish!", answer) | ||
if ( | ||
answer.reactDOMVersion === null || | ||
answer.reactHotLoaderVersion === null | ||
) { | ||
throw new Error("Versions to publish by can't be null"); | ||
} | ||
|
||
const patchedPackageDir = await getAndPatchGivenReactDOMVersionWithGivenRHLVersion( | ||
path.resolve(__dirname, "staging-area"), | ||
answer.reactDOMVersion, | ||
answer.reactHotLoaderVersion, | ||
"test-org-bnaya-2" | ||
); | ||
|
||
console.info("don't really publish yet", { patchedPackageDir }); | ||
|
||
// const publishStdOut = await execFile( | ||
// "yarn", | ||
// [ | ||
// "publish", | ||
// "--tag", | ||
// ourDistTag + "_rc", | ||
// "-y", | ||
// "--access", | ||
// "public", | ||
// "--json" | ||
// ], | ||
// patchedPackageDir, | ||
// 10000 | ||
// ); | ||
|
||
// console.info("Done publishing!", { publishStdOut }); | ||
} else { | ||
console.info("Nothing to publish"); | ||
} | ||
})(); |
Oops, something went wrong.