Merge pull request #38 from aleleba/PR-843991

PR-843991: updating packages and changing the github actions workflow to use only one file.
This commit is contained in:
Alejandro Lembke Barrientos 2023-11-10 12:36:16 -06:00 committed by GitHub
commit d46f7cd866
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 732 additions and 717 deletions

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

@ -0,0 +1,79 @@
# This file contains the main workflow for the create-react-component-library project. It defines the steps and actions that are executed when a pull request is opened or pushed to the repository. The workflow includes building and testing the project, as well as deploying it to GitHub Pages if the build is successful.
# Name of the workflow
name: Testing package
# Events that trigger the workflow
on:
push:
branches: [ master ]
pull_request:
branches: ['*']
# Jobs that run as part of 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
- run: npm test
# Job to run Cypress tests
cypress-run:
runs-on: ubuntu-latest
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/
- name: Cypress install
run: npm install
- name: Cypress run
uses: cypress-io/github-action@v5
with:
install: false
component: true
# Job to build the package
test-build-package:
if: github.ref != 'refs/heads/master'
needs: [ test, cypress-run ]
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, cypress-run ]
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
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

View File

@ -1,43 +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
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress install
run: npm install --legacy-peer-deps
- name: Cypress run
uses: cypress-io/github-action@v5 # use the explicit version number
with:
install: false
component: true
publish-npm:
needs: [ build, cypress-run ]
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,47 +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
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress install
run: npm install --legacy-peer-deps
- name: Cypress run
uses: cypress-io/github-action@v5 # use the explicit version number
with:
install: false
component: true
test-build-package:
needs: [ test, cypress-run ]
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

1268
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@aleleba/create-react-component-library",
"version": "1.2.15",
"version": "1.2.16",
"description": "A starter kit for create a React component Library with storybook",
"bin": "./bin/cli.js",
"main": "dist/index.js",
@ -35,10 +35,10 @@
},
"homepage": "https://github.com/aleleba/create-react-component-library#readme",
"devDependencies": {
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.23.2",
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/register": "^7.22.15",
"@mdx-js/react": "^3.0.0",
"@storybook/addon-actions": "^7.5.3",
@ -64,7 +64,7 @@
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.8.1",
"css-minimizer-webpack-plugin": "^5.0.1",
"cypress": "^13.4.0",
"cypress": "^13.5.0",
"dotenv": "^16.3.1",
"eslint": "^8.53.0",
"eslint-plugin-react": "^7.33.2",