From 8f9cc6bb9f7e6328a128c42a11d3fd9dda0b44bc Mon Sep 17 00:00:00 2001 From: Steven Fawcett <64777084+sfawcett123@users.noreply.github.com> Date: Tue, 6 Dec 2022 22:59:14 +0000 Subject: [PATCH] Update npm-publish.yml --- .github/workflows/npm-publish.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index ea0c121..c7c4993 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,11 +1,11 @@ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages -name: Node.js Package +name: Publish on: - release: - types: [created] + push: + branches: [ "main" ] jobs: build: @@ -18,19 +18,23 @@ jobs: - run: npm ci - run: | npm install - gulp - - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + npm run build + + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@main + + - uses: rickstaa/action-create-tag@v1 + with: + tag: ${{ steps.package-version.outputs.current-version }} + message: "Latest release" + force_push_tag: true + - uses: actions/setup-node@v3 with: node-version: 16 registry-url: https://registry.npmjs.org/ - - run: npm ci - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}