Merge pull request #3 from cristopher1/development #4
Workflow file for this run
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
# Workflow to use continuos delivery | |
name: CD | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
test_and_build: | |
name: Test and build the distributable generator-koa2-api-generator | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install dependencies | |
run: npm ci | |
- name: audit | |
run: npm audit | |
- name: run quality check | |
run: npm run quality-check | |
- name: build the dist folder | |
run: npm run build | |
- name: save artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: distributable-generator-koa2-api-generator | |
path: | | |
dist | |
LICENSE | |
README.md | |
package.json | |
retention-days: 1 | |
release: | |
name: Create new release | |
runs-on: ubuntu-latest | |
needs: test_and_build | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: create a new release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: ${{ github.ref_name }} | |
body_path: RELEASE_NOTES.md | |
publish: | |
name: publish generator-koa2-api-generator package | |
runs-on: ubuntu-latest | |
needs: release | |
environment: publish | |
steps: | |
- name: download generator-koa2-api-generator distribuible | |
uses: actions/download-artifact@v4 | |
with: | |
name: distributable-generator-koa2-api-generator | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: publish generator-koa2-api-generator en npm | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} |