From b18b16bc5589d8841f2bfe8401f44200ce7eef80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Wed, 11 Jun 2025 16:13:48 +0200 Subject: [PATCH] feat: ability to run npm release from branch --- .github/workflows/release.yaml | 6 ++++++ scripts/npm-tag.js | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a1fa6162fb..b75685752a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,11 @@ name: 'Publish to npm' on: + workflow_dispatch: + inputs: + version: + description: "Which version number should we use for the release" + type: 'string' + required: true workflow_call: inputs: version: diff --git a/scripts/npm-tag.js b/scripts/npm-tag.js index 228cabf95a..decbd37777 100644 --- a/scripts/npm-tag.js +++ b/scripts/npm-tag.js @@ -1,9 +1,10 @@ -const semver = require('semver'); +import semver from 'semver'; +import { createRequire } from 'node:module'; +const require = createRequire(import.meta.url); +const { version } = require('../package.json'); const latestUnleashVersion = process.argv[2]; -const version = require('../package.json').version; - function isPrerelease(version) { const arr = semver.prerelease(version); return arr && arr.length > 0;