diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 1b54dd1678..b9ce8eaca0 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -173,8 +173,3 @@ jobs: AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) 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) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000000..2502249ee3 --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -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 }} diff --git a/Makefile b/Makefile index dfeb43fe0e..d2b7cc9dd8 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,7 @@ build-npm: build-extension-types copy-extension-themes src/extensions/npm/extens yarn npm:fix-package-version .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 publish-npm: node_modules build-npm