Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: set the compiled bin to executable #180

Open
wants to merge 8 commits into
base: alpha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
run: npx nx affected --target=test --parallel --max-parallel=3
- name: '🧪 Test ava'
run: npx nx affected --target=ava --parallel --max-parallel=3
# - name: '🔎 E2E'
# run: cd packages/srp && npm run e2e
- name: '🔎 E2E'
run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx affected --target=e2e --parallel --max-parallel=3
- name: '🏗️ Build'
run: npx nx affected --target=build --configuration=production --parallel --max-parallel=3
run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx affected --target=build --configuration=production --parallel --max-parallel=3
- name: '📦 Release'
run: NX_CLOUD_DISTRIBUTED_EXECUTION=false npx nx affected --target=release
- run: npx nx-cloud stop-all-agents
Expand Down
9 changes: 8 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
"runner": "@nrwl/nx-cloud",
"options": {
"accessToken": "MDAwNWM4NjktMDY1Yi00YmFkLTg5OTUtZjNhMjhmYjEzNzU0fHJlYWQ=",
"cacheableOperations": ["build", "test", "ava", "lint", "e2e"],
"cacheableOperations": [
"pre-build",
"build",
"test",
"ava",
"lint",
"e2e"
],
"canTrackAnalytics": true,
"showUsageWarnings": true,
"parallel": 1
Expand Down
4 changes: 2 additions & 2 deletions packages/srp/docs/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ Type: `Boolean`<br>
Default: `false`<br>
CLI argument: `--debug`

Output debugging information. This can also be enabled by setting the `DEBUG` environment variable to `semantic-release:*`.
Output debugging information. This can also be enabled by setting the `DEBUG` environment variable to `semantic-release-plus:*`.

**Note**: The `debug` is used only supported via CLI argument. To enable debug mode from the [JS API](../developer-guide/js-api.md#javascript-api) use `require('debug').enable('semantic-release:*')`.
**Note**: The `debug` is used only supported via CLI argument. To enable debug mode from the [JS API](../developer-guide/js-api.md#javascript-api) use `require('debug').enable('semantic-release-plus:*')`.

## Git environment variables

Expand Down
29 changes: 27 additions & 2 deletions packages/srp/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sourceRoot": "packages/srp/src",
"projectType": "library",
"targets": {
"build": {
"pre-build": {
"executor": "@nrwl/node:package",
"outputs": ["{options.outputPath}"],
"options": {
Expand All @@ -14,6 +14,25 @@
"assets": ["packages/srp/*.md"]
}
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/srp",
"commands": [
"ls -latr dist/packages/srp/src/bin",
"chmod +x dist/packages/srp/src/bin/semantic-release-plus.js",
"ls -latr dist/packages/srp/src/bin"
],
"parallel": false
},
"dependsOn": [
{
"target": "pre-build",
"projects": "self"
}
]
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
Expand All @@ -39,7 +58,13 @@
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "e2e"
}
},
"dependsOn": [
{
"target": "build",
"projects": "self"
}
]
},
"release": {
"executor": "@nrwl/workspace:run-script",
Expand Down
2 changes: 1 addition & 1 deletion packages/srp/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Usage:

if (options.debug) {
// Debug must be enabled before other requires in order to work
require('debug').enable('semantic-release:*');
require('debug').enable('semantic-release-plus:*');
}

await require('.')(options);
Expand Down
2 changes: 1 addition & 1 deletion packages/srp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ async function logErrors({ logger, stderr }, err) {
}
} else {
logger.error(
'An error occurred while running semantic-release: %O',
'An error occurred while running semantic-release-plus: %O',
error
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/srp/src/lib/get-commits.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const debug = require('debug')('semantic-release:get-commits');
const debug = require('debug')('semantic-release-plus:get-commits');
const { getCommits } = require('./git');
const { stronsole } = require('./stronsole');

Expand Down
2 changes: 1 addition & 1 deletion packages/srp/src/lib/get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { castArray, pickBy, isNil, isString, isPlainObject } = require('lodash');
const readPkgUp = require('read-pkg-up');
const { cosmiconfig } = require('cosmiconfig');
const resolveFrom = require('resolve-from');
const debug = require('debug')('semantic-release:config');
const debug = require('debug')('semantic-release-plus:config');
const { repoUrl } = require('./git');
const PLUGINS_DEFINITIONS = require('./definitions/plugins');
const plugins = require('./plugins');
Expand Down
2 changes: 1 addition & 1 deletion packages/srp/src/lib/get-git-auth-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { parse, format } = require('url');
const { isNil } = require('lodash');
const hostedGitInfo = require('hosted-git-info');
const { verifyAuth } = require('./git');
const debug = require('debug')('semantic-release:get-git-auth-url');
const debug = require('debug')('semantic-release-plus:get-git-auth-url');

/**
* Machinery to format a repository URL with the given credentials
Expand Down
2 changes: 1 addition & 1 deletion packages/srp/src/lib/plugins/normalize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { isPlainObject, isFunction, noop, cloneDeep, omit } = require('lodash');
const debug = require('debug')('semantic-release:plugins');
const debug = require('debug')('semantic-release-plus:plugins');
const getError = require('../get-error');
const { extractErrors } = require('../utils');
const PLUGINS_DEFINITIONS = require('../definitions/plugins');
Expand Down
2 changes: 1 addition & 1 deletion packages/srp/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ test('Log all "verifyConditions" errors', async (t) => {
);
t.true(
t.context.error.calledWith(
'An error occurred while running semantic-release: %O',
'An error occurred while running semantic-release-plus: %O',
error1
)
);
Expand Down
7 changes: 6 additions & 1 deletion packages/srp/test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ const npmTestEnv = {
).toString('base64'),
};

const cli = require.resolve('../src/bin/semantic-release-plus');
const cli = require.resolve(
'../../../dist/packages/srp/src/bin/semantic-release-plus'
);
const pluginError = require.resolve('./fixtures/plugin-error');
const pluginInheritedError = require.resolve(
'./fixtures/plugin-error-inherited'
Expand All @@ -72,6 +74,9 @@ const pluginLogEnv = require.resolve('./fixtures/plugin-log-env');

test.before(async () => {
await Promise.all([gitbox.start(), npmRegistry.start(), mockServer.start()]);
const res = await execa(cli, ['--version']);
console.log(__dirname);
console.log(res);
});

test.after.always(async () => {
Expand Down