PR-257071: updating packages and using only one workflow in github actions.

This commit is contained in:
Alejandro Lembke Barrientos 2023-11-10 17:53:17 +00:00
parent 7de0026c4d
commit 95174fd166
5 changed files with 695 additions and 672 deletions

60
.github/workflows/main-workflow.yml vendored Normal file
View File

@ -0,0 +1,60 @@
# This file contains the main workflow for the GitHub Actions CI/CD pipeline for a Node.js TypeScript GraphQL server project.
# Name of the workflow
name: Main Workflow
# Define the event that triggers the workflow
on:
push:
branches: [ master ]
pull_request:
branches: ['*']
# Define the jobs that will run in the workflow
jobs:
# Job to run tests
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
registry-url: https://registry.npmjs.org/
- run: npm ci --legacy-peer-deps
- run: npm test
# Job to build the package
test-build-package:
if: github.ref != 'refs/heads/master'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci --legacy-peer-deps
- run: npm run build
# Job to publish the package to npm
publish-npm:
if: github.ref == 'refs/heads/master'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci --legacy-peer-deps
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

View File

@ -1,30 +0,0 @@
name: NPM testing and publish package
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci --legacy-peer-deps
- run: npm test
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci --legacy-peer-deps
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

View File

@ -1,33 +0,0 @@
name: Testing package
on:
pull_request:
branches: ['*']
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
registry-url: https://registry.npmjs.org/
- run: npm ci --legacy-peer-deps
- run: npm test
test-build-package:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci --legacy-peer-deps
- run: npm run build

1236
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@aleleba/create-node-ts-graphql-server",
"version": "1.5.9",
"version": "1.5.10",
"description": "Node with Typescript and GraphQL Server",
"bin": "./bin/cli.js",
"main": "index.js",
@ -53,9 +53,9 @@
"ws": "^8.14.2"
},
"devDependencies": {
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@babel/preset-typescript": "^7.23.2",
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/register": "^7.22.15",
"@types/body-parser": "^1.19.5",
"@types/cookie-parser": "^1.4.6",