agregando los tags a los push #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI and Release | |
on: | |
push: | |
tags: | |
- '*' | |
branches: | |
- '*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20, 18, 16] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm install | |
- name: Generate coverage report | |
run: npm run coverage | |
- name: Upload coverage to Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./coverage/lcov.info | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm install | |
- name: Release to NPM | |
uses: npm/cli-github-action@v2 | |
with: | |
email: ${{ secrets.NPM_EMAIL }} | |
token: ${{ secrets.NPM_TOKEN }} |