diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6676a53..fe358d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,31 +49,3 @@ jobs: with: args: > -Dsonar.branch.name=${{ env.GITHUB_REF_NAME }} - build-and-publish: - if: github.ref == 'refs/heads/master' && startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - strategy: - matrix: - node-version: ['18.x'] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - registry-url: 'https://registry.npmjs.org' - - name: Cache node modules - uses: actions/cache@v2 - with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Install dependencies - run: npm install - - name: Build - run: npm run build - - name: npm publish - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.github/workflows/npm_package.yml b/.github/workflows/npm_package.yml new file mode 100644 index 0000000..7fa2301 --- /dev/null +++ b/.github/workflows/npm_package.yml @@ -0,0 +1,32 @@ +name: NPM Package Release + +on: + push: + tags: + - '*' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - name: Cache node modules + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install dependencies + run: npm install + - name: Build (if needed for publication) + run: npm run build + - name: npm publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}