Publish npm package via gh actions (#2695)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2021-05-04 09:47:52 -04:00
1 parent 1af12fe59e
commit bf96e6ef4c
3 files changed
+34 -6

No files matched your search

-5
View File
@@ -173,8 +173,3 @@ jobs:
AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
BUILD_NUMBER: $(Build.BuildNumber) BUILD_NUMBER: $(Build.BuildNumber)
- script: make publish-npm
displayName: Publish npm package
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
env:
NPM_TOKEN: $(NPM_TOKEN)
+33
View File
@@ -0,0 +1,33 @@
name: Publish NPM
on:
release:
types:
- published
jobs:
publish:
name: Publish NPM
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: Checkout Release
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Generate NPM package
run: |
make build-npm
- name: publish new release
if: contains(github.ref, 'refs/tags/v')
run: |
make publish-npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+1 -1
View File
@@ -106,7 +106,7 @@ build-npm: build-extension-types copy-extension-themes src/extensions/npm/extens
yarn npm:fix-package-version yarn npm:fix-package-version
.PHONY: build-extension-types .PHONY: build-extension-types
build-extension-types: src/extensions/npm/extensions/dist build-extension-types: node_modules src/extensions/npm/extensions/dist
.PHONY: publish-npm .PHONY: publish-npm
publish-npm: node_modules build-npm publish-npm: node_modules build-npm