Skip to content

Commit f7ac84b

Browse files
authored
1 parent 0f28ebd commit f7ac84b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

release.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ npm pack --pack-destination "$PWD" --workspace @mdx-js/language-service
33
npm pack --pack-destination "$PWD" --workspace @mdx-js/language-server
44
npx --workspace vscode-mdx vsce package --out "$PWD"
55

6+
node scripts/tag-extension.mjs
67
npx changeset publish
78
npx ovsx publish --packagePath ./*.vsix
89
npx vsce publish --packagePath ./*.vsix

scripts/tag-extension.mjs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env node
2+
import assert from 'node:assert/strict'
3+
import {spawnSync} from 'node:child_process'
4+
// eslint-disable-next-line import/order
5+
import {createRequire} from 'node:module'
6+
7+
const require = createRequire(import.meta.url)
8+
const pkg = require('../packages/vscode-mdx/package.json')
9+
10+
const tag = `${pkg.name}@${pkg.version}`
11+
12+
const {status, stdout, error} = spawnSync('git', [
13+
'ls-remote',
14+
pkg.repository.url,
15+
tag
16+
])
17+
18+
assert.equal(status, 0, error)
19+
20+
const exists = String(stdout).trim() !== ''
21+
22+
if (!exists) {
23+
console.log(`\nNew tag: ${tag}`)
24+
}

0 commit comments

Comments
 (0)