Skip to content

Commit

Permalink
Merge pull request #166 from open-rpc/fix/build
Browse files Browse the repository at this point in the history
fix: build filter get-version
  • Loading branch information
BelfordZ authored Apr 18, 2019
2 parents e602d41 + 2dbe3f9 commit 4756e0d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 23 deletions.
18 changes: 1 addition & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,13 @@ jobs:
- run: npm test
- save_cache: *save-deps-cache

build:
<<: *defaults
steps:
- checkout
- restore_cache: *restore-deps-cache
- run: npm install
- run: ./bin/build.sh
- save_cache: *save-deps-cache

release:
<<: *defaults
steps:
- checkout
- restore_cache: *restore-deps-cache
- run: npm install
- run: ./bin/build.sh
- run: npm test
- run: npx semantic-release
- save_cache: *save-deps-cache

Expand All @@ -65,23 +56,16 @@ workflows:
jobs:
- test:
filters: *filter-only-semantic-pr
- build:
filters: *filter-only-semantic-pr
requires:
- test

release:
jobs:
- test:
filters: *filter-only-master
- build:
filters: *filter-only-master
- hold:
filters: *filter-only-master
type: approval
requires:
- test
- build
- release:
filters: *filter-only-master
requires:
Expand Down
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"allowed_elements": ["p", "img", "a"]
},
"MD013": false,
"MD025": false
"MD025": false,
"MD004": false
}
2 changes: 1 addition & 1 deletion bin/build.markdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const build = async () => {
await fsx.ensureDir(buildDir);
await fsx.emptyDir(buildDir);
const specContent = await readFile("./spec.md", "utf8");
const withToc = toc(specContent).content;
const withToc = toc.insert(specContent);
const withVersion = replaceVersionComments(withToc);
await writeFile(`${buildDir}/spec.md`, withVersion);

Expand Down
7 changes: 4 additions & 3 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ const build = async () => {
const buildScriptFilenames = await readdir(__dirname);

const buildTargets = buildScriptFilenames
.filter((filename) => filename !== "build.sh")
.filter((filename) => filename.includes("build.") && filename !== "build.sh")
.map((filename) => filename.split(".")[1]);

// run each build script
const output = await Promise.all(buildTargets.map((buildTarget) => execFile(`${__dirname}/build.${buildTarget}.sh`)));
buildTargets.forEach(async (buildTarget) => {
await require(`${__dirname}/build.${buildTarget}.sh`)();
});

console.log("build complete");
};
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"description": "The OPEN-RPC Specification",
"main": "index.js",
"scripts": {
"test": "node_modules/.bin/mdv ./*.md && ./node_modules/.bin/markdownlint ./README.md ./spec.md"
"validate": "node_modules/.bin/mdv ./spec.md ./README.md ./build/markdown/*.md",
"lint": "./node_modules/.bin/markdownlint ./spec.md ./README.md ./build/markdown/*.md",
"build": "./bin/build.sh",
"test": "npm run build && npm run validate && npm run lint"
},
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ In the following description, if a field is not explicitly **REQUIRED** or descr
This document is licensed under [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).

<!-- toc -->
<!-- tocstop -->

# Introduction

Expand Down

0 comments on commit 4756e0d

Please sign in to comment.