semantic-release-vsce 5.7.3 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yaml +12 -3
- package/README.md +47 -10
- package/eslint.config.js +7 -0
- package/index.js +13 -21
- package/lib/prepare.js +8 -7
- package/lib/publish.js +14 -8
- package/lib/utils.js +17 -13
- package/lib/verify-ovsx-auth.js +5 -4
- package/lib/verify-pkg.js +7 -8
- package/lib/verify-target.js +6 -5
- package/lib/verify-vsce-auth.js +25 -10
- package/lib/verify.js +10 -10
- package/package.json +22 -23
- package/release.config.js +9 -1
- package/test/index.test.js +115 -56
- package/test/prepare.test.js +50 -31
- package/test/publish.test.js +155 -41
- package/test/verify-ovsx-auth.test.js +21 -17
- package/test/verify-pkg.test.js +32 -41
- package/test/verify-target.test.js +20 -17
- package/test/verify-vsce-auth.test.js +123 -29
- package/test/verify.test.js +152 -80
- package/.eslintrc +0 -14
|
@@ -10,6 +10,9 @@ on:
|
|
|
10
10
|
- master
|
|
11
11
|
- next
|
|
12
12
|
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
13
16
|
jobs:
|
|
14
17
|
test:
|
|
15
18
|
runs-on: ubuntu-latest
|
|
@@ -17,9 +20,8 @@ jobs:
|
|
|
17
20
|
strategy:
|
|
18
21
|
matrix:
|
|
19
22
|
node-version:
|
|
20
|
-
- 16
|
|
21
|
-
- 18
|
|
22
23
|
- 20
|
|
24
|
+
- 22
|
|
23
25
|
|
|
24
26
|
steps:
|
|
25
27
|
- uses: actions/checkout@v4
|
|
@@ -34,11 +36,18 @@ jobs:
|
|
|
34
36
|
|
|
35
37
|
needs: test
|
|
36
38
|
|
|
39
|
+
permissions:
|
|
40
|
+
contents: write # to be able to publish a GitHub release
|
|
41
|
+
issues: write # to be able to comment on released issues
|
|
42
|
+
pull-requests: write # to be able to comment on released pull requests
|
|
43
|
+
id-token: write # to enable use of OIDC for npm provenance
|
|
44
|
+
|
|
37
45
|
steps:
|
|
38
46
|
- uses: actions/checkout@v4
|
|
39
47
|
- uses: volta-cli/action@v4
|
|
40
48
|
- run: npm ci
|
|
41
|
-
- run: npm
|
|
49
|
+
- run: npm audit signatures
|
|
50
|
+
- run: npx semantic-release
|
|
42
51
|
env:
|
|
43
52
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
44
53
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/README.md
CHANGED
|
@@ -96,11 +96,12 @@ The directory of the extension relative to the current working directory. Defaul
|
|
|
96
96
|
|
|
97
97
|
The following environment variables are supported by this plugin:
|
|
98
98
|
|
|
99
|
-
| Variable
|
|
100
|
-
|
|
|
101
|
-
| `OVSX_PAT`
|
|
102
|
-
| `VSCE_PAT`
|
|
103
|
-
| `
|
|
99
|
+
| Variable | Description |
|
|
100
|
+
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| `OVSX_PAT` | _Optional_. The personal access token to push to Open VSX Registry |
|
|
102
|
+
| `VSCE_PAT` | _Optional_. The personal access token to publish to Visual Studio Marketplace. _Note:_ Cannot be set at the same time as `VSCE_AZURE_CREDENTIAL`. |
|
|
103
|
+
| `VSCE_AZURE_CREDENTIAL` | _Optional_. When set to `true` or `1`, `vsce` will use the `--azure-credential` flag to authenticate. _Note:_ Cannot be set at the same time as `VSCE_PAT`. |
|
|
104
|
+
| `VSCE_TARGET` | _Optional_. The target to use when packaging or publishing the extension (used as `vsce package --target ${VSCE_TARGET}`). When set to `universal`, behave as if `VSCE_TARGET` was not set (i.e. build the universal/generic `vsix`). See [the platform-specific example](#platform-specific-on-github-actions) |
|
|
104
105
|
|
|
105
106
|
### Configuring `vsce`
|
|
106
107
|
|
|
@@ -193,7 +194,10 @@ jobs:
|
|
|
193
194
|
|
|
194
195
|
```js
|
|
195
196
|
// package.release.config.js
|
|
196
|
-
|
|
197
|
+
/**
|
|
198
|
+
* @type {import('semantic-release').GlobalConfig}
|
|
199
|
+
*/
|
|
200
|
+
export default {
|
|
197
201
|
plugins: [
|
|
198
202
|
'@semantic-release/commit-analyzer',
|
|
199
203
|
'@semantic-release/release-notes-generator',
|
|
@@ -213,7 +217,10 @@ jobs:
|
|
|
213
217
|
|
|
214
218
|
```js
|
|
215
219
|
// publish.release.config.js
|
|
216
|
-
|
|
220
|
+
/**
|
|
221
|
+
* @type {import('semantic-release').GlobalConfig}
|
|
222
|
+
*/
|
|
223
|
+
export default {
|
|
217
224
|
plugins: [
|
|
218
225
|
'@semantic-release/commit-analyzer',
|
|
219
226
|
'@semantic-release/release-notes-generator',
|
|
@@ -254,9 +261,6 @@ jobs:
|
|
|
254
261
|
- os: windows-latest
|
|
255
262
|
target: win32-x64
|
|
256
263
|
npm_config_arch: x64
|
|
257
|
-
- os: windows-latest
|
|
258
|
-
target: win32-ia32
|
|
259
|
-
npm_config_arch: ia32
|
|
260
264
|
- os: windows-latest
|
|
261
265
|
target: win32-arm64
|
|
262
266
|
npm_config_arch: arm
|
|
@@ -336,4 +340,37 @@ jobs:
|
|
|
336
340
|
OVSX_PAT: ${{ secrets.OVSX_PAT }}
|
|
337
341
|
```
|
|
338
342
|
|
|
343
|
+
### GitHub Actions - Release to VS Marketplace with Azure credentials
|
|
344
|
+
|
|
345
|
+
```yaml
|
|
346
|
+
name: release
|
|
347
|
+
|
|
348
|
+
on:
|
|
349
|
+
push:
|
|
350
|
+
branches: [master]
|
|
351
|
+
|
|
352
|
+
jobs:
|
|
353
|
+
release:
|
|
354
|
+
runs-on: ubuntu-latest
|
|
355
|
+
steps:
|
|
356
|
+
- uses: actions/checkout@v3
|
|
357
|
+
- uses: actions/setup-node@v3
|
|
358
|
+
with:
|
|
359
|
+
node-version: 16
|
|
360
|
+
- run: npm ci
|
|
361
|
+
|
|
362
|
+
# Log into Azure CLI to get VSCE credentials
|
|
363
|
+
- name: Azure login
|
|
364
|
+
uses: azure/login@v2
|
|
365
|
+
with:
|
|
366
|
+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
|
367
|
+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
368
|
+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
369
|
+
|
|
370
|
+
- run: npx semantic-release
|
|
371
|
+
env:
|
|
372
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
373
|
+
VSCE_AZURE_CREDENTIAL: 'true'
|
|
374
|
+
```
|
|
375
|
+
|
|
339
376
|
A reference implementation can also be found in the [VS Code ShellCheck extension](https://github.com/vscode-shellcheck/vscode-shellcheck/pull/805).
|
package/eslint.config.js
ADDED
package/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { prepare as vscePrepare } from './lib/prepare.js';
|
|
5
|
+
import { publish as vscePublish } from './lib/publish.js';
|
|
6
|
+
import { verify as vsceVerify } from './lib/verify.js';
|
|
7
7
|
|
|
8
8
|
let verified = false;
|
|
9
9
|
let prepared = false;
|
|
10
10
|
let packagePath;
|
|
11
11
|
|
|
12
|
-
async function verifyConditions(pluginConfig, { logger, cwd }) {
|
|
12
|
+
export async function verifyConditions(pluginConfig, { logger, cwd }) {
|
|
13
13
|
cwd = getPackageRoot(pluginConfig, cwd);
|
|
14
|
-
await
|
|
14
|
+
await vsceVerify(pluginConfig, { logger, cwd });
|
|
15
15
|
verified = true;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async function prepare(
|
|
18
|
+
export async function prepare(
|
|
19
19
|
pluginConfig,
|
|
20
20
|
{ nextRelease: { version }, logger, cwd },
|
|
21
21
|
) {
|
|
22
22
|
cwd = getPackageRoot(pluginConfig, cwd);
|
|
23
23
|
if (!verified) {
|
|
24
|
-
await
|
|
24
|
+
await vsceVerify(pluginConfig, { logger, cwd });
|
|
25
25
|
verified = true;
|
|
26
26
|
}
|
|
27
27
|
packagePath = await vscePrepare(
|
|
@@ -33,13 +33,13 @@ async function prepare(
|
|
|
33
33
|
prepared = true;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
async function publish(
|
|
36
|
+
export async function publish(
|
|
37
37
|
pluginConfig,
|
|
38
38
|
{ nextRelease: { version }, logger, cwd },
|
|
39
39
|
) {
|
|
40
40
|
cwd = getPackageRoot(pluginConfig, cwd);
|
|
41
41
|
if (!verified) {
|
|
42
|
-
await
|
|
42
|
+
await vsceVerify(pluginConfig, { logger, cwd });
|
|
43
43
|
verified = true;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -60,21 +60,13 @@ async function publish(
|
|
|
60
60
|
|
|
61
61
|
if (pluginConfig?.publishPackagePath) {
|
|
62
62
|
// Expand glob
|
|
63
|
-
const
|
|
64
|
-
packagePath =
|
|
63
|
+
const glob = (await import('glob')).glob;
|
|
64
|
+
packagePath = await glob(pluginConfig.publishPackagePath, { cwd });
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
return vscePublish(version, packagePath, logger, cwd);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
function getPackageRoot(pluginConfig, cwd) {
|
|
71
|
-
return pluginConfig.packageRoot
|
|
72
|
-
? path.join(cwd, pluginConfig.packageRoot)
|
|
73
|
-
: cwd;
|
|
71
|
+
return pluginConfig.packageRoot ? join(cwd, pluginConfig.packageRoot) : cwd;
|
|
74
72
|
}
|
|
75
|
-
|
|
76
|
-
module.exports = {
|
|
77
|
-
verifyConditions,
|
|
78
|
-
prepare,
|
|
79
|
-
publish,
|
|
80
|
-
};
|
package/lib/prepare.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { execa } from 'execa';
|
|
4
|
+
import { readJson } from 'fs-extra/esm';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import process from 'node:process';
|
|
7
|
+
import { isOvsxPublishEnabled, isTargetEnabled } from './utils.js';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
export async function prepare(version, packageVsix, logger, cwd) {
|
|
9
10
|
if (packageVsix === false) {
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
@@ -24,7 +25,7 @@ module.exports = async (version, packageVsix, logger, cwd) => {
|
|
|
24
25
|
if (typeof packageVsix === 'string') {
|
|
25
26
|
packagePath = packageVsix;
|
|
26
27
|
} else {
|
|
27
|
-
const { name } = await readJson(
|
|
28
|
+
const { name } = await readJson(join(cwd, './package.json'));
|
|
28
29
|
if (isTargetEnabled()) {
|
|
29
30
|
packagePath = `${name}-${process.env.VSCE_TARGET}-${version}.vsix`;
|
|
30
31
|
} else {
|
|
@@ -49,4 +50,4 @@ module.exports = async (version, packageVsix, logger, cwd) => {
|
|
|
49
50
|
|
|
50
51
|
return packagePath;
|
|
51
52
|
}
|
|
52
|
-
}
|
|
53
|
+
}
|
package/lib/publish.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { execa } from 'execa';
|
|
4
|
+
import { readJson } from 'fs-extra/esm';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import process from 'node:process';
|
|
7
|
+
import {
|
|
8
|
+
isAzureCredentialEnabled,
|
|
7
9
|
isOvsxPublishEnabled,
|
|
8
10
|
isTargetEnabled,
|
|
9
11
|
isVscePublishEnabled,
|
|
10
|
-
}
|
|
12
|
+
} from './utils.js';
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
const { publisher, name } = await readJson(
|
|
14
|
+
export async function publish(version, packagePath, logger, cwd) {
|
|
15
|
+
const { publisher, name } = await readJson(join(cwd, './package.json'));
|
|
14
16
|
|
|
15
17
|
const options = ['publish'];
|
|
16
18
|
|
|
@@ -33,6 +35,10 @@ module.exports = async (version, packagePath, logger, cwd) => {
|
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
if (isAzureCredentialEnabled()) {
|
|
39
|
+
options.push('--azure-credential');
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
const releases = [];
|
|
37
43
|
if (isVscePublishEnabled()) {
|
|
38
44
|
logger.log(message + ' to Visual Studio Marketplace');
|
|
@@ -64,4 +70,4 @@ module.exports = async (version, packagePath, logger, cwd) => {
|
|
|
64
70
|
// TODO: uncomment after https://github.com/semantic-release/semantic-release/issues/2123
|
|
65
71
|
// return releases;
|
|
66
72
|
return releases.shift();
|
|
67
|
-
}
|
|
73
|
+
}
|
package/lib/utils.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import process from 'node:process';
|
|
4
|
+
|
|
5
|
+
function envToBoolean(name) {
|
|
6
|
+
return process.env[name] === 'true' || process.env[name] === '1';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function isOvsxPublishEnabled() {
|
|
4
10
|
return 'OVSX_PAT' in process.env;
|
|
5
|
-
}
|
|
11
|
+
}
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
return '
|
|
9
|
-
}
|
|
13
|
+
export function isAzureCredentialEnabled() {
|
|
14
|
+
return envToBoolean('VSCE_AZURE_CREDENTIAL');
|
|
15
|
+
}
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
export function isVscePublishEnabled() {
|
|
18
|
+
return 'VSCE_PAT' in process.env || isAzureCredentialEnabled();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function isTargetEnabled() {
|
|
12
22
|
return (
|
|
13
23
|
'VSCE_TARGET' in process.env && process.env.VSCE_TARGET !== 'universal'
|
|
14
24
|
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = {
|
|
18
|
-
isTargetEnabled,
|
|
19
|
-
isOvsxPublishEnabled,
|
|
20
|
-
isVscePublishEnabled,
|
|
21
|
-
};
|
|
25
|
+
}
|
package/lib/verify-ovsx-auth.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import SemanticReleaseError from '@semantic-release/error';
|
|
4
|
+
import { execa } from 'execa';
|
|
5
|
+
import process from 'node:process';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
export async function verifyOvsxAuth(logger, cwd) {
|
|
7
8
|
logger.log('Verifying authentication for ovsx');
|
|
8
9
|
|
|
9
10
|
if (!process.env.OVSX_PAT) {
|
|
@@ -21,4 +22,4 @@ module.exports = async (logger, cwd) => {
|
|
|
21
22
|
'EINVALIDOVSXPAT',
|
|
22
23
|
);
|
|
23
24
|
}
|
|
24
|
-
}
|
|
25
|
+
}
|
package/lib/verify-pkg.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const path = require('path');
|
|
3
|
+
import SemanticReleaseError from '@semantic-release/error';
|
|
4
|
+
import { pathExists, readJson } from 'fs-extra/esm';
|
|
5
|
+
import { join } from 'node:path';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
const packagePath =
|
|
7
|
+
export async function verifyPkg(cwd) {
|
|
8
|
+
const packagePath = join(cwd, './package.json');
|
|
10
9
|
|
|
11
|
-
if (!
|
|
10
|
+
if (!(await pathExists(packagePath))) {
|
|
12
11
|
throw new SemanticReleaseError(
|
|
13
12
|
`${packagePath} was not found. A \`package.json\` is required to release with vsce.`,
|
|
14
13
|
'ENOPKG',
|
|
@@ -40,4 +39,4 @@ module.exports = async (cwd) => {
|
|
|
40
39
|
'ENOPUBLISHER',
|
|
41
40
|
);
|
|
42
41
|
}
|
|
43
|
-
}
|
|
42
|
+
}
|
package/lib/verify-target.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import SemanticReleaseError from '@semantic-release/error';
|
|
4
|
+
import process from 'node:process';
|
|
5
|
+
import { isTargetEnabled } from './utils.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
export async function verifyTarget() {
|
|
7
8
|
if (!isTargetEnabled()) {
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
@@ -16,7 +17,7 @@ module.exports = async () => {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
if (process.env.VSCE_TARGET !== 'universal') {
|
|
19
|
-
const targets =
|
|
20
|
+
const targets = (await import('@vscode/vsce/out/package.js')).Targets;
|
|
20
21
|
|
|
21
22
|
// Throw if the target is not supported
|
|
22
23
|
if (!targets.has(process.env.VSCE_TARGET)) {
|
|
@@ -28,4 +29,4 @@ module.exports = async () => {
|
|
|
28
29
|
);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
}
|
|
32
|
+
}
|
package/lib/verify-vsce-auth.js
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import SemanticReleaseError from '@semantic-release/error';
|
|
4
|
+
import { execa } from 'execa';
|
|
5
|
+
import process from 'node:process';
|
|
6
|
+
import { isAzureCredentialEnabled } from './utils.js';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
export async function verifyVsceAuth(logger, cwd) {
|
|
9
|
+
const pat = 'VSCE_PAT' in process.env && process.env.VSCE_PAT;
|
|
10
|
+
const azureCredential = isAzureCredentialEnabled();
|
|
8
11
|
|
|
9
|
-
if (!
|
|
12
|
+
if (!pat && !azureCredential) {
|
|
10
13
|
throw new SemanticReleaseError(
|
|
11
|
-
'
|
|
12
|
-
'
|
|
14
|
+
'Neither vsce personal access token (`VSCE_PAT` environment variable) or azure credential flag (`VSCE_AZURE_CREDENTIAL` environment variable) specified.',
|
|
15
|
+
'EVSCEAUTHNOTPROVIDED',
|
|
13
16
|
);
|
|
14
17
|
}
|
|
15
18
|
|
|
19
|
+
if (pat && azureCredential) {
|
|
20
|
+
throw new SemanticReleaseError(
|
|
21
|
+
'Both vsce personal access token (`VSCE_PAT` environment variable) and azure credential flag (`VSCE_AZURE_CREDENTIAL` environment variable) specified. Please use only one.',
|
|
22
|
+
'EVSCEDUPLICATEAUTHPROVIDED',
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const vsceArgs = ['verify-pat'];
|
|
27
|
+
if (azureCredential) {
|
|
28
|
+
vsceArgs.push('--azure-credential');
|
|
29
|
+
}
|
|
30
|
+
|
|
16
31
|
try {
|
|
17
|
-
await execa('vsce',
|
|
32
|
+
await execa('vsce', vsceArgs, { preferLocal: true, cwd });
|
|
18
33
|
} catch (e) {
|
|
19
34
|
throw new SemanticReleaseError(
|
|
20
|
-
`Invalid vsce personal access token. Additional information:\n\n${e}`,
|
|
35
|
+
`Invalid vsce personal access token or azure credential. Additional information:\n\n${e}`,
|
|
21
36
|
'EINVALIDVSCEPAT',
|
|
22
37
|
);
|
|
23
38
|
}
|
|
24
|
-
}
|
|
39
|
+
}
|
package/lib/verify.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import SemanticReleaseError from '@semantic-release/error';
|
|
4
|
+
import { isOvsxPublishEnabled, isVscePublishEnabled } from './utils.js';
|
|
5
|
+
import { verifyOvsxAuth } from './verify-ovsx-auth.js';
|
|
6
|
+
import { verifyPkg } from './verify-pkg.js';
|
|
7
|
+
import { verifyTarget } from './verify-target.js';
|
|
8
|
+
import { verifyVsceAuth } from './verify-vsce-auth.js';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
export async function verify(pluginConfig, { logger, cwd }) {
|
|
11
11
|
await verifyPkg(cwd);
|
|
12
12
|
await verifyTarget();
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ module.exports = async (pluginConfig, { logger, cwd }) => {
|
|
|
16
16
|
const ovsxPublishEnabled = isOvsxPublishEnabled();
|
|
17
17
|
if (!vscePublishEnabled && !ovsxPublishEnabled) {
|
|
18
18
|
throw new SemanticReleaseError(
|
|
19
|
-
'No personal access token was detected. Set
|
|
19
|
+
'No personal access token was detected. Set `VSCE_PAT`, `VSCE_AZURE_CREDENTIAL`, or the `OVSX_PAT` environment variable. At least one of them must be present when publish is enabled.\nLearn more at https://github.com/felipecrs/semantic-release-vsce#publishing',
|
|
20
20
|
'ENOPAT',
|
|
21
21
|
);
|
|
22
22
|
}
|
|
@@ -24,7 +24,7 @@ module.exports = async (pluginConfig, { logger, cwd }) => {
|
|
|
24
24
|
await verifyVsceAuth(logger, cwd);
|
|
25
25
|
} else {
|
|
26
26
|
logger.log(
|
|
27
|
-
'Skipping verification of the vsce personal access token as the `VSCE_PAT` environment
|
|
27
|
+
'Skipping verification of the vsce personal access token as the `VSCE_PAT` or `VSCE_AZURE_CREDENTIAL` environment variables are not set.\n\nDid you know you can easily start publishing to Visual Studio Marketplace with `semantic-release-vsce`?\nLearn more at https://github.com/felipecrs/semantic-release-vsce#publishing-to-visual-studio-marketplace',
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
if (ovsxPublishEnabled) {
|
|
@@ -35,4 +35,4 @@ module.exports = async (pluginConfig, { logger, cwd }) => {
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semantic-release-vsce",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "semantic-release plugin to package and publish VS Code extensions",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
8
|
+
"node": "^20.8.1 || >=22.0.0"
|
|
8
9
|
},
|
|
9
10
|
"repository": "https://github.com/felipecrs/semantic-release-vsce.git",
|
|
10
11
|
"bugs": "https://github.com/felipecrs/semantic-release-vsce/issues",
|
|
@@ -21,10 +22,9 @@
|
|
|
21
22
|
],
|
|
22
23
|
"main": "index.js",
|
|
23
24
|
"scripts": {
|
|
24
|
-
"lint": "prettier --check . && eslint . ",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"posttest": "npm run lint && installed-check --ignore-dev --ignore=semantic-release",
|
|
25
|
+
"lint": "prettier --check . && eslint . && installed-check --ignore-dev",
|
|
26
|
+
"test": "c8 ava",
|
|
27
|
+
"posttest": "npm run lint",
|
|
28
28
|
"prepare": "husky"
|
|
29
29
|
},
|
|
30
30
|
"ava": {
|
|
@@ -43,39 +43,38 @@
|
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
"volta": {
|
|
46
|
-
"node": "
|
|
47
|
-
"npm": "
|
|
46
|
+
"node": "22.12.0",
|
|
47
|
+
"npm": "11.0.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@semantic-release/error": "^
|
|
51
|
-
"@vscode/vsce": "^
|
|
52
|
-
"execa": "^5.
|
|
50
|
+
"@semantic-release/error": "^4.0.0",
|
|
51
|
+
"@vscode/vsce": "^3.0.0",
|
|
52
|
+
"execa": "^9.5.2",
|
|
53
53
|
"fs-extra": "^11.1.0",
|
|
54
|
-
"glob": "^
|
|
55
|
-
"ovsx": "^0.
|
|
54
|
+
"glob": "^11.0.0",
|
|
55
|
+
"ovsx": "^0.10.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"semantic-release": ">=
|
|
58
|
+
"semantic-release": ">=20"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"ava": "^6.1.2",
|
|
62
|
+
"c8": "^10.1.3",
|
|
62
63
|
"conventional-changelog-conventionalcommits": "^8.0.0",
|
|
63
|
-
"eslint": "^
|
|
64
|
-
"
|
|
65
|
-
"eslint-config-standard": "^17.0.0",
|
|
66
|
-
"eslint-plugin-import": "^2.20.1",
|
|
67
|
-
"eslint-plugin-n": "^16.6.2",
|
|
68
|
-
"eslint-plugin-promise": "^6.0.0",
|
|
64
|
+
"eslint": "^9.12.0",
|
|
65
|
+
"esmock": "^2.6.9",
|
|
69
66
|
"husky": "^9.0.11",
|
|
70
67
|
"installed-check": "^9.0.0",
|
|
71
68
|
"lint-staged": "^15.0.1",
|
|
72
|
-
"
|
|
69
|
+
"neostandard": "^0.12.0",
|
|
73
70
|
"prettier": "^3.2.5",
|
|
74
|
-
"proxyquire": "^2.1.3",
|
|
75
71
|
"semantic-release": "^24.0.0",
|
|
76
|
-
"sinon": "^
|
|
72
|
+
"sinon": "^19.0.2"
|
|
77
73
|
},
|
|
78
74
|
"lint-staged": {
|
|
79
75
|
"**/*": "prettier --write --ignore-unknown"
|
|
76
|
+
},
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"provenance": true
|
|
80
79
|
}
|
|
81
80
|
}
|
package/release.config.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @type {import('semantic-release').GlobalConfig}
|
|
3
|
+
*/
|
|
4
|
+
export default {
|
|
2
5
|
plugins: [
|
|
3
6
|
[
|
|
4
7
|
'@semantic-release/commit-analyzer',
|
|
@@ -17,6 +20,11 @@ module.exports = {
|
|
|
17
20
|
scope: 'deps',
|
|
18
21
|
release: 'patch',
|
|
19
22
|
},
|
|
23
|
+
// https://github.com/semantic-release/commit-analyzer/issues/413#issuecomment-1465299187
|
|
24
|
+
{
|
|
25
|
+
breaking: true,
|
|
26
|
+
release: 'major',
|
|
27
|
+
},
|
|
20
28
|
],
|
|
21
29
|
},
|
|
22
30
|
],
|