diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fc05cd5d3..911a103728 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,7 @@ jobs: commit: master tag: ${{ steps.tagger.outputs.tagname }} body: ${{ github.event.pull_request.body }} + prerelease: ${{ endsWith(steps.tagger.outputs.tagname, '-alpha') || endsWith(steps.tagger.outputs.tagname, '-beta') }} publish-npm: uses: ./.github/workflows/publish-release-npm.yml needs: release diff --git a/Makefile b/Makefile index b6b14141ba..b7c0cd3b8d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ CMD_ARGS = $(filter-out $@,$(MAKECMDGOALS)) %: @: -NPM_RELEASE_TAG ?= latest ELECTRON_BUILDER_EXTRA_ARGS ?= ifeq ($(OS),Windows_NT) @@ -84,13 +83,11 @@ build-extension-types: node_modules packages/extensions/dist .PHONY: publish-extensions-npm publish-extensions-npm: node_modules build-extensions-npm - ./node_modules/.bin/npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" - cd packages/extensions && npm publish --access=public --tag=$(NPM_RELEASE_TAG) && git restore package.json + ./scripts/publish-extensions-npm.sh .PHONY: publish-library-npm publish-library-npm: node_modules build-library-npm - ./node_modules/.bin/npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" - npm publish --access=public --tag=$(NPM_RELEASE_TAG) + ./scripts/publish-library-npm.sh .PHONY: build-docs build-docs: diff --git a/scripts/publish-extensions-npm.sh b/scripts/publish-extensions-npm.sh new file mode 100755 index 0000000000..a715bc73d4 --- /dev/null +++ b/scripts/publish-extensions-npm.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +./node_modules/.bin/npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" + +NPM_RELEASE_TAG=$(cat package.json | jq .version --raw-output | rg '.*-(?P\w+).*' -r '$channel' | cat) + +cd packages/extensions && npm publish --access=public --tag=${NPM_RELEASE_TAG:-latest} && git restore package.json diff --git a/scripts/publish-library-npm.sh b/scripts/publish-library-npm.sh new file mode 100755 index 0000000000..6fdd16e8a8 --- /dev/null +++ b/scripts/publish-library-npm.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +./node_modules/.bin/npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" + +NPM_RELEASE_TAG=$(cat package.json | jq .version --raw-output | rg '.*-(?P\w+).*' -r '$channel' | cat) + +npm publish --access=public --tag=${NPM_RELEASE_TAG:-latest} diff --git a/yarn.lock b/yarn.lock index 3f4672f51e..451e181e5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5899,10 +5899,10 @@ eslint-plugin-react-hooks@^4.6.0: resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== -eslint-plugin-react@7.32.1: - version "7.32.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.32.1.tgz#88cdeb4065da8ca0b64e1274404f53a0f9890200" - integrity sha512-vOjdgyd0ZHBXNsmvU+785xY8Bfe57EFbTYYk8XrROzWpr9QBvpjITvAXt9xqcE6+8cjR/g1+mfumPToxsl1www== +eslint-plugin-react@7.32.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.32.0.tgz#d80f794a638c5770f952ba2ae793f0a516be7c09" + integrity sha512-vSBi1+SrPiLZCGvxpiZIa28fMEUaMjXtCplrvxcIxGzmFiYdsXQDwInEjuv5/i/2CTTxbkS87tE8lsQ0Qxinbw== dependencies: array-includes "^3.1.6" array.prototype.flatmap "^1.3.1"