semantic-release-vsce 6.0.3 → 6.0.5

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/README.md CHANGED
@@ -158,17 +158,26 @@ name: release
158
158
 
159
159
  on:
160
160
  push:
161
- branches: [master]
161
+ branches:
162
+ - master
163
+
164
+ permissions:
165
+ contents: read # for checkout
162
166
 
163
167
  jobs:
164
168
  release:
165
169
  runs-on: ubuntu-latest
170
+ permissions:
171
+ contents: write # to be able to publish a GitHub release
172
+ issues: write # to be able to comment on released issues
173
+ pull-requests: write # to be able to comment on released pull requests
166
174
  steps:
167
- - uses: actions/checkout@v3
168
- - uses: actions/setup-node@v3
175
+ - uses: actions/checkout@v4
176
+ - uses: actions/setup-node@v4
169
177
  with:
170
- node-version: 16
178
+ node-version: 22
171
179
  - run: npm ci
180
+ - run: npm audit signatures
172
181
  - run: npx semantic-release
173
182
  env:
174
183
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -228,13 +237,13 @@ jobs:
228
237
  'semantic-release-vsce',
229
238
  {
230
239
  packageVsix: false,
231
- publishPackagePath: '*/*.vsix',
240
+ publishPackagePath: '*.vsix',
232
241
  },
233
242
  ],
234
243
  [
235
244
  '@semantic-release/github',
236
245
  {
237
- assets: '*/*.vsix',
246
+ assets: '*.vsix',
238
247
  },
239
248
  ],
240
249
  ],
@@ -251,7 +260,11 @@ name: ci
251
260
 
252
261
  on:
253
262
  push:
254
- branches: [master]
263
+ branches:
264
+ - master
265
+
266
+ permissions:
267
+ contents: read # for checkout
255
268
 
256
269
  jobs:
257
270
  build:
@@ -276,6 +289,9 @@ jobs:
276
289
  - os: ubuntu-latest
277
290
  target: alpine-x64
278
291
  npm_config_arch: x64
292
+ - os: ubuntu-latest
293
+ target: alpine-arm64
294
+ npm_config_arch: arm64
279
295
  - os: macos-latest
280
296
  target: darwin-x64
281
297
  npm_config_arch: x64
@@ -286,22 +302,18 @@ jobs:
286
302
  target: universal
287
303
  runs-on: ${{ matrix.os }}
288
304
  steps:
289
- - uses: actions/checkout@v3
290
-
291
- - uses: actions/setup-node@v3
305
+ - uses: actions/checkout@v4
306
+ - uses: actions/setup-node@v4
292
307
  with:
293
- node-version: 16
294
-
308
+ node-version: 22
295
309
  - if: matrix.target != 'universal'
296
310
  name: Install dependencies (with binaries)
297
311
  run: npm ci
298
312
  env:
299
313
  npm_config_arch: ${{ matrix.npm_config_arch }}
300
-
301
314
  - if: matrix.target == 'universal'
302
315
  name: Install dependencies (without binaries)
303
316
  run: npm ci
304
-
305
317
  - run: npx semantic-release --extends ./package.release.config.js
306
318
  env:
307
319
  VSCE_TARGET: ${{ matrix.target }}
@@ -311,8 +323,7 @@ jobs:
311
323
  VSCE_PAT: ${{ secrets.VSCE_PAT }}
312
324
  # In case you want to publish to Open VSX Registry
313
325
  OVSX_PAT: ${{ secrets.OVSX_PAT }}
314
-
315
- - uses: actions/upload-artifact@v3
326
+ - uses: actions/upload-artifact@v4
316
327
  with:
317
328
  name: ${{ matrix.target }}
318
329
  path: '*.vsix'
@@ -320,17 +331,20 @@ jobs:
320
331
  release:
321
332
  runs-on: ubuntu-latest
322
333
  needs: build
334
+ permissions:
335
+ contents: write # to be able to publish a GitHub release
336
+ issues: write # to be able to comment on released issues
337
+ pull-requests: write # to be able to comment on released pull requests
323
338
  steps:
324
- - uses: actions/checkout@v3
325
-
326
- - uses: actions/setup-node@v3
339
+ - uses: actions/checkout@v4
340
+ - uses: actions/download-artifact@v4
327
341
  with:
328
- node-version: 16
329
-
342
+ merge-multiple: true
343
+ - uses: actions/setup-node@v4
344
+ with:
345
+ node-version: 22
330
346
  - run: npm ci
331
-
332
- - uses: actions/download-artifact@v3
333
-
347
+ - run: npm audit signatures
334
348
  - run: npx semantic-release --extends ./publish.release.config.js
335
349
  env:
336
350
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -347,26 +361,31 @@ name: release
347
361
 
348
362
  on:
349
363
  push:
350
- branches: [master]
364
+ branches:
365
+ - master
366
+
367
+ permissions:
368
+ contents: read # for checkout
351
369
 
352
370
  jobs:
353
371
  release:
354
372
  runs-on: ubuntu-latest
373
+ permissions:
374
+ contents: write # to be able to publish a GitHub release
375
+ issues: write # to be able to comment on released issues
376
+ pull-requests: write # to be able to comment on released pull requests
355
377
  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
378
+ - uses: actions/checkout@v4
379
+ - uses: azure/login@v2
365
380
  with:
366
381
  client-id: ${{ secrets.AZURE_CLIENT_ID }}
367
382
  tenant-id: ${{ secrets.AZURE_TENANT_ID }}
368
383
  subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
369
-
384
+ - uses: actions/setup-node@v4
385
+ with:
386
+ node-version: 22
387
+ - run: npm ci
388
+ - run: npm audit signatures
370
389
  - run: npx semantic-release
371
390
  env:
372
391
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @ts-check
2
2
 
3
- import { join } from 'node:path';
3
+ import path from 'node:path';
4
4
  import { prepare as vscePrepare } from './lib/prepare.js';
5
5
  import { publish as vscePublish } from './lib/publish.js';
6
6
  import { verify as vsceVerify } from './lib/verify.js';
@@ -60,7 +60,7 @@ export async function publish(
60
60
 
61
61
  if (pluginConfig?.publishPackagePath) {
62
62
  // Expand glob
63
- const glob = (await import('glob')).glob;
63
+ const { glob } = await import('glob');
64
64
  packagePath = await glob(pluginConfig.publishPackagePath, { cwd });
65
65
  }
66
66
 
@@ -68,5 +68,7 @@ export async function publish(
68
68
  }
69
69
 
70
70
  function getPackageRoot(pluginConfig, cwd) {
71
- return pluginConfig.packageRoot ? join(cwd, pluginConfig.packageRoot) : cwd;
71
+ return pluginConfig.packageRoot
72
+ ? path.join(cwd, pluginConfig.packageRoot)
73
+ : cwd;
72
74
  }
package/lib/prepare.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { execa } from 'execa';
4
4
  import { readJson } from 'fs-extra/esm';
5
- import { join } from 'node:path';
5
+ import path from 'node:path';
6
6
  import process from 'node:process';
7
7
  import { isOvsxPublishEnabled, isTargetEnabled } from './utils.js';
8
8
 
@@ -25,12 +25,10 @@ export async function prepare(version, packageVsix, logger, cwd) {
25
25
  if (typeof packageVsix === 'string') {
26
26
  packagePath = packageVsix;
27
27
  } else {
28
- const { name } = await readJson(join(cwd, './package.json'));
29
- if (isTargetEnabled()) {
30
- packagePath = `${name}-${process.env.VSCE_TARGET}-${version}.vsix`;
31
- } else {
32
- packagePath = `${name}-${version}.vsix`;
33
- }
28
+ const { name } = await readJson(path.join(cwd, './package.json'));
29
+ packagePath = isTargetEnabled()
30
+ ? `${name}-${process.env.VSCE_TARGET}-${version}.vsix`
31
+ : `${name}-${version}.vsix`;
34
32
  }
35
33
 
36
34
  logger.log(`Packaging version ${version} to ${packagePath}`);
package/lib/publish.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { execa } from 'execa';
4
4
  import { readJson } from 'fs-extra/esm';
5
- import { join } from 'node:path';
5
+ import path from 'node:path';
6
6
  import process from 'node:process';
7
7
  import {
8
8
  isAzureCredentialEnabled,
@@ -12,7 +12,7 @@ import {
12
12
  } from './utils.js';
13
13
 
14
14
  export async function publish(version, packagePath, logger, cwd) {
15
- const { publisher, name } = await readJson(join(cwd, './package.json'));
15
+ const { publisher, name } = await readJson(path.join(cwd, './package.json'));
16
16
 
17
17
  const options = ['publish'];
18
18
 
package/lib/utils.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import process from 'node:process';
4
4
 
5
- function envToBoolean(name) {
5
+ function environmentToBoolean(name) {
6
6
  return process.env[name] === 'true' || process.env[name] === '1';
7
7
  }
8
8
 
@@ -11,7 +11,7 @@ export function isOvsxPublishEnabled() {
11
11
  }
12
12
 
13
13
  export function isAzureCredentialEnabled() {
14
- return envToBoolean('VSCE_AZURE_CREDENTIAL');
14
+ return environmentToBoolean('VSCE_AZURE_CREDENTIAL');
15
15
  }
16
16
 
17
17
  export function isVscePublishEnabled() {
@@ -16,9 +16,9 @@ export async function verifyOvsxAuth(logger, cwd) {
16
16
 
17
17
  try {
18
18
  await execa('ovsx', ['verify-pat'], { preferLocal: true, cwd });
19
- } catch (e) {
19
+ } catch (error) {
20
20
  throw new SemanticReleaseError(
21
- `Invalid ovsx personal access token. Additional information:\n\n${e}`,
21
+ `Invalid ovsx personal access token. Additional information:\n\n${error}`,
22
22
  'EINVALIDOVSXPAT',
23
23
  );
24
24
  }
@@ -2,10 +2,10 @@
2
2
 
3
3
  import SemanticReleaseError from '@semantic-release/error';
4
4
  import { pathExists, readJson } from 'fs-extra/esm';
5
- import { join } from 'node:path';
5
+ import path from 'node:path';
6
6
 
7
- export async function verifyPkg(cwd) {
8
- const packagePath = join(cwd, './package.json');
7
+ export async function verifyPackage(cwd) {
8
+ const packagePath = path.join(cwd, './package.json');
9
9
 
10
10
  if (!(await pathExists(packagePath))) {
11
11
  throw new SemanticReleaseError(
@@ -17,7 +17,8 @@ export async function verifyTarget() {
17
17
  }
18
18
 
19
19
  if (process.env.VSCE_TARGET !== 'universal') {
20
- const targets = (await import('@vscode/vsce/out/package.js')).Targets;
20
+ const vscePackage = await import('@vscode/vsce/out/package.js');
21
+ const targets = vscePackage.Targets;
21
22
 
22
23
  // Throw if the target is not supported
23
24
  if (!targets.has(process.env.VSCE_TARGET)) {
@@ -23,16 +23,16 @@ export async function verifyVsceAuth(logger, cwd) {
23
23
  );
24
24
  }
25
25
 
26
- const vsceArgs = ['verify-pat'];
26
+ const vsceArguments = ['verify-pat'];
27
27
  if (azureCredential) {
28
- vsceArgs.push('--azure-credential');
28
+ vsceArguments.push('--azure-credential');
29
29
  }
30
30
 
31
31
  try {
32
- await execa('vsce', vsceArgs, { preferLocal: true, cwd });
33
- } catch (e) {
32
+ await execa('vsce', vsceArguments, { preferLocal: true, cwd });
33
+ } catch (error) {
34
34
  throw new SemanticReleaseError(
35
- `Invalid vsce personal access token or azure credential. Additional information:\n\n${e}`,
35
+ `Invalid vsce personal access token or azure credential. Additional information:\n\n${error}`,
36
36
  'EINVALIDVSCEPAT',
37
37
  );
38
38
  }
package/lib/verify.js CHANGED
@@ -3,12 +3,12 @@
3
3
  import SemanticReleaseError from '@semantic-release/error';
4
4
  import { isOvsxPublishEnabled, isVscePublishEnabled } from './utils.js';
5
5
  import { verifyOvsxAuth } from './verify-ovsx-auth.js';
6
- import { verifyPkg } from './verify-pkg.js';
6
+ import { verifyPackage } from './verify-package.js';
7
7
  import { verifyTarget } from './verify-target.js';
8
8
  import { verifyVsceAuth } from './verify-vsce-auth.js';
9
9
 
10
10
  export async function verify(pluginConfig, { logger, cwd }) {
11
- await verifyPkg(cwd);
11
+ await verifyPackage(cwd);
12
12
  await verifyTarget();
13
13
 
14
14
  if (pluginConfig?.publish !== false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-release-vsce",
3
- "version": "6.0.3",
3
+ "version": "6.0.5",
4
4
  "description": "semantic-release plugin to package and publish VS Code extensions",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -66,6 +66,7 @@
66
66
  "c8": "^10.1.3",
67
67
  "conventional-changelog-conventionalcommits": "^8.0.0",
68
68
  "eslint": "^9.12.0",
69
+ "eslint-plugin-unicorn": "^56.0.1",
69
70
  "esmock": "^2.6.9",
70
71
  "husky": "^9.0.11",
71
72
  "installed-check": "^9.0.0",