Skip to content

Commit

Permalink
Merge pull request #93 from TransbankDevelopers/chore/fix-publish-job
Browse files Browse the repository at this point in the history
chore: fix publish job
  • Loading branch information
tribiec authored Feb 2, 2024
2 parents 2b296a4 + 7760564 commit cbe24e0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
32 changes: 32 additions & 0 deletions .github/workflows/npm_package.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit cbe24e0

Please sign in to comment.