Skip to content

Commit

Permalink
Publish to the correct channels instead of always latest (lensapp#6963)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>
  • Loading branch information
Nokel81 authored Jan 18, 2023
1 parent ec84eee commit 5fc8ec6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ CMD_ARGS = $(filter-out $@,$(MAKECMDGOALS))
%:
@:

NPM_RELEASE_TAG ?= latest
ELECTRON_BUILDER_EXTRA_ARGS ?=

ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions scripts/publish-extensions-npm.sh
Original file line number Diff line number Diff line change
@@ -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<channel>\w+).*' -r '$channel' | cat)

cd packages/extensions && npm publish --access=public --tag=${NPM_RELEASE_TAG:-latest} && git restore package.json
7 changes: 7 additions & 0 deletions scripts/publish-library-npm.sh
Original file line number Diff line number Diff line change
@@ -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<channel>\w+).*' -r '$channel' | cat)

npm publish --access=public --tag=${NPM_RELEASE_TAG:-latest}

0 comments on commit 5fc8ec6

Please sign in to comment.