Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
randymarsh77 committed Jun 3, 2020
2 parents bbcd26d + e3ca451 commit 0641877
Show file tree
Hide file tree
Showing 16 changed files with 4,337 additions and 11,120 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
if: tag IS blank

os: osx
language: node_js
node_js:
Expand Down
38 changes: 21 additions & 17 deletions build-ci.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
const shell = require('shelljs');
const path = require('path');
const process = require('process');

const packages = ['packages/lib', 'packages/cli', 'packages/vscode'];
const createExecYarn = package => args => {
shell.config.execPath = shell.which('node').toString();
const { code } = shell.exec(
`yarn ${(package && `workspace ${package}`) || ''} ${(args || []).join(' ')}`
);
if (code !== 0) {
console.error('Failing build due to last error.');
process.exit(1);
}
};

const packages = ['nuget-extensions-lib', 'nuget-extensions', 'nuget-extensions-vscode'];

createExecYarn()();

packages.reduce((_, package) => {
const execYarn = args => {
shell.config.execPath = shell.which('node').toString();
const { code } = shell.exec(`yarn ${args.join(' ')}`, {
cwd: path.join(process.cwd(), package),
});
if (code !== 0) {
console.error('Failing build due to last error.');
process.exit(1);
}
};
const execYarn = createExecYarn(package);

console.log(`\nBuilding ${package}\n`);
execYarn(['--force']);

if (package === 'packages/vscode') {
if (package === 'nuget-extensions-vscode') {
execYarn(['link', 'nuget-extensions-lib']);
}

execYarn(['build']);

if (package === 'packages/lib') {
if (package === 'nuget-extensions-lib') {
// yarn install destroys symlinks (in devDependency deps), make sure `yarn jest` works.
execYarn(['add', '--dev', 'jest-cli']);
execYarn(['link']);
}

// The current travis.yml doesn't support launching VSCode windows for integration tests.
if (package === 'packages/lib') {
if (package === 'nuget-extensions-lib') {
execYarn(['test', '--coverage']);
}

if (package === 'packages/vscode') {
// Only release from Travis, not Appveyor.
if (process.env.TRAVIS) {
execYarn(['semantic-release']);
}

return _;
}, {});
9 changes: 0 additions & 9 deletions lerna.json

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
"name": "nuget-extensions-packages",
"workspaces": [
"packages/lib",
"packages/cli"
"packages/cli",
"packages/vscode"
],
"scripts": {
"test": "node build-ci.js"
},
"devDependencies": {
"@semantic-release/npm": "^7.0.5",
"@types/jest": "^24.0.11",
"@types/lodash.debounce": "^4.0.5",
"@types/lodash.mergewith": "^4.6.6",
Expand All @@ -19,7 +21,6 @@
"@types/user-home": "^2.0.0",
"@types/yargs": "^12.0.9",
"github-api": "^3.3.0",
"lerna": "^3.13.1",
"prettier": "^1.16.4",
"shelljs": "^0.8.3",
"tslint": "^5.12.1",
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuget-extensions",
"version": "0.0.11",
"version": "0.0.0-managed-by-semantic-release",
"description": "Extensions for the NuGet CLI",
"main": "index.js",
"bin": {
Expand Down Expand Up @@ -30,6 +30,8 @@
"yargs": "^13.2.1"
},
"devDependencies": {
"jest-cli": "^24.5.0"
"filtered-commit-analyzer": "^0.0.1",
"jest-cli": "^24.5.0",
"semantic-release": "^17.0.8"
}
}
16 changes: 16 additions & 0 deletions packages/cli/release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
branches: ['release'],
tagFormat: 'cli@v${version}',
plugins: [
[
'filtered-commit-analyzer',
{
preset: 'angular',
filterRules: {
scope: 'cli',
},
},
],
'@semantic-release/npm',
],
};
Loading

0 comments on commit 0641877

Please sign in to comment.