Skip to content

Commit

Permalink
build: use release-please for automating releases (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Sep 13, 2021
1 parent c155900 commit 35309f7
Show file tree
Hide file tree
Showing 39 changed files with 243 additions and 223 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
branches:
- master
pull_request:
name: ci
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [8, 12, 14, 16]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: node --version
# The first installation step ensures that all of our production
# dependencies work on the given Node.js version, this helps us find
# dependencies that don't match our engines field:
- run: npm install --production --engine-strict --ignore-scripts --no-package-lock
# Clean up the production install, before installing dev/production:
- run: rm -rf node_modules
- run: npm install
- run: npm test
env:
MOCHA_THROW_DEPRECATION: false
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
- run: npm test
env:
MOCHA_THROW_DEPRECATION: false
34 changes: 34 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
push:
branches:
- master
name: release-please-submodule
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v2
with:
command: manifest
token: ${{ secrets.GITHUB_TOKEN }}
default-branch: master
publish:
runs-on: ubuntu-latest
needs: release-please
strategy:
fail-fast: false
matrix:
path: ${{fromJson(needs.release.outputs.paths_released || '[]')}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: 'https://external-dot-oss-automation.appspot.com/'
- name: publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_MONOREPO_TOKEN}}
run: |
cd ${{ matrix.path }}
npm install
npm publish --access=public
13 changes: 13 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"reporter": ["text", "lcov"],
"exclude": [
"**/*-test",
"**/coverage",
"**/test",
"**/*.d.ts",
".jsdoc.js",
"**/.jsdoc.js"
],
"exclude-after-remap": false,
"all": true
}
11 changes: 11 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"packages/istanbul-lib-coverage": "3.0.0",
"packages/istanbul-lib-hook": "3.0.0",
"packages/istanbul-lib-instrument": "4.0.3",
"packages/istanbul-lib-report": "3.0.0",
"packages/istanbul-lib-source-maps": "4.0.0",
"packages/istanbul-reports": "3.0.2",
"packages/nyc-config-babel": "3.0.0",
"packages/nyc-config-hook-run-in-this-context": "1.0.0",
"packages/nyc-config-typescript": "1.0.1"
}
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Greenkeeper badge](https://badges.greenkeeper.io/istanbuljs/istanbuljs.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/istanbuljs/istanbuljs.svg?branch=master)](https://travis-ci.org/istanbuljs/istanbuljs)
[![Coverage Status](https://coveralls.io/repos/istanbuljs/istanbuljs/badge.svg?branch=master)](https://coveralls.io/r/istanbuljs/istanbuljs?branch=master)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![community slack](http://devtoolscommunity.herokuapp.com/badge.svg)](http://devtoolscommunity.herokuapp.com)

Expand Down
23 changes: 0 additions & 23 deletions greenkeeper.json

This file was deleted.

5 changes: 0 additions & 5 deletions lerna.json

This file was deleted.

35 changes: 0 additions & 35 deletions monorepo-merge-reports.js

This file was deleted.

10 changes: 0 additions & 10 deletions monorepo-per-package-full.js

This file was deleted.

6 changes: 0 additions & 6 deletions monorepo-per-package-nycrc.json

This file was deleted.

13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
"private": true,
"description": "monorepo containing the various nuts and bolts that facilitate istanbul.js test instrumentation",
"scripts": {
"pretest": "eslint .",
"test": "cross-env LERNA_TEST_RUN=1 NODE_ENV=test lerna --ignore nyc exec npm test",
"posttest": "node ./monorepo-merge-reports.js && nyc report",
"postinstall": "lerna bootstrap --hoist",
"release": "lerna publish --conventional-commits --dist-tag=next"
"test": "cross-env NODE_ENV=test nyc mocha --timeout 30000 packages/*/test{,/*}.js",
"posttest": "eslint .",
"fix": "eslint .",
"postinstall": "bash scripts/install.sh"
},
"repository": {
"type": "git",
Expand All @@ -35,8 +34,8 @@
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.17.0",
"glob": "^7.1.6",
"lerna": "^3.19.0",
"nyc": "^15.0.0-beta.2",
"mocha": "^7.2.0",
"nyc": "^15.1.0",
"prettier": "=1.18.2"
},
"nyc": {
Expand Down
2 changes: 1 addition & 1 deletion packages/istanbul-lib-coverage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"index.js"
],
"scripts": {
"test": "nyc --nycrc-path=../../monorepo-per-package-full.js mocha"
"test": "nyc mocha"
},
"devDependencies": {
"chai": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/istanbul-lib-hook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"index.js"
],
"scripts": {
"test": "nyc --nycrc-path=../../monorepo-per-package-full.js mocha"
"test": "nyc mocha"
},
"dependencies": {
"append-transform": "^2.0.0"
Expand Down
5 changes: 0 additions & 5 deletions packages/istanbul-lib-instrument/babel.config.js

This file was deleted.

17 changes: 7 additions & 10 deletions packages/istanbul-lib-instrument/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,30 @@
"version": "4.0.3",
"description": "Core istanbul API for JS code coverage",
"author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>",
"main": "dist/index.js",
"main": "src/index.js",
"files": [
"dist"
"src"
],
"scripts": {
"release": "babel src --out-dir dist && documentation build -f md -o api.md src",
"test": "nyc --nycrc-path=../../monorepo-per-package-nycrc.json --require=@babel/register --include=src mocha",
"prepublish": "npm run release"
"test": "nyc mocha"
},
"dependencies": {
"@babel/core": "^7.7.5",
"@babel/core": "^7.12.3",
"@babel/parser": "^7.14.7",
"@istanbuljs/schema": "^0.1.2",
"istanbul-lib-coverage": "^3.0.0",
"semver": "^6.3.0"
},
"devDependencies": {
"@babel/cli": "^7.7.5",
"@babel/plugin-transform-modules-commonjs": "^7.7.5",
"@babel/register": "^7.7.4",
"chai": "^4.2.0",
"clone": "^2.1.2",
"debug": "^4.1.1",
"documentation": "^12.1.4",
"js-yaml": "^3.13.1",
"mocha": "^6.2.2",
"mocha": "^6.2.3",
"nopt": "^4.0.1",
"nyc": "^15.0.0-beta.2"
"nyc": "^15.1.0"
},
"license": "BSD-3-Clause",
"bugs": {
Expand Down
22 changes: 11 additions & 11 deletions packages/istanbul-lib-instrument/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createHash } from 'crypto';
import { major } from 'semver';
import { name, version } from '../package.json';
const { createHash } = require('crypto');
const { major } = require('semver');
const { name, version } = require('../package.json');

// function to use for creating hashes
export const SHA = 'sha1';
// name of coverage data magic key
export const MAGIC_KEY = '_coverageSchema';
// name of coverage data magic value
export const MAGIC_VALUE = createHash(SHA)
.update(name + '@' + major(version))
.digest('hex');
const SHA = 'sha1';
module.exports = {
SHA,
MAGIC_KEY: '_coverageSchema',
MAGIC_VALUE: createHash(SHA)
.update(name + '@' + major(version))
.digest('hex')
};
19 changes: 10 additions & 9 deletions packages/istanbul-lib-instrument/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defaults } from '@istanbuljs/schema';
import Instrumenter from './instrumenter';
import programVisitor from './visitor';
import readInitialCoverage from './read-coverage';
const { defaults } = require('@istanbuljs/schema');
const Instrumenter = require('./instrumenter');
const programVisitor = require('./visitor');
const readInitialCoverage = require('./read-coverage');

/**
* createInstrumenter creates a new instrumenter with the
Expand All @@ -13,8 +13,9 @@ function createInstrumenter(opts) {
return new Instrumenter(opts);
}

export { createInstrumenter };
export { programVisitor };
export { readInitialCoverage };

export const defaultOpts = defaults.instrumenter;
module.exports = {
createInstrumenter,
programVisitor,
readInitialCoverage,
defaultOpts: defaults.instrumenter
};
10 changes: 5 additions & 5 deletions packages/istanbul-lib-instrument/src/instrumenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Copyright 2012-2015, Yahoo Inc.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
import { transformSync } from '@babel/core';
import { defaults } from '@istanbuljs/schema';
import programVisitor from './visitor';
import readInitialCoverage from './read-coverage';
const { transformSync } = require('@babel/core');
const { defaults } = require('@istanbuljs/schema');
const programVisitor = require('./visitor');
const readInitialCoverage = require('./read-coverage');

/**
* Instrumenter is the public API for the instrument library.
Expand Down Expand Up @@ -155,4 +155,4 @@ class Instrumenter {
}
}

export default Instrumenter;
module.exports = Instrumenter;

0 comments on commit 35309f7

Please sign in to comment.