Skip to content

Commit

Permalink
feat(ci): update ci
Browse files Browse the repository at this point in the history
feat(ci): update ci
  • Loading branch information
leifermendez committed Dec 9, 2022
2 parents f05ff4c + 9d5aa7d commit e5a9db7
Show file tree
Hide file tree
Showing 44 changed files with 786 additions and 577 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages/docs/*
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ module.exports = {
parserOptions: {
ecmaVersion: 'latest',
},
rules: {},
rules: {
'no-unsafe-negation': 'off',
'no-prototype-builtins': 'off',
'no-useless-escape': 'off',
},
}
163 changes: 152 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,168 @@
name: Bot CI Test
name: BotWhatsapp CI

on:
push:
branches: [dev]
branches:
- main
pull_request:
branches: [main]
branches:
- main
- dev

jobs:
build:
############ BUILD PACKAGE ############
build-package:
name: Build Package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
registry-url: https://registry.npmjs.org/

- run: corepack enable

- name: Install NPM Dependencies
run: yarn install --immutable --network-timeout 300000

- name: Build Package
run: yarn build

- name: Test Package
run: yarn test

- name: Upload @bot-whatsapp/bot
uses: actions/upload-artifact@master
with:
name: dist-dev-bot
path: packages/bot/lib/
if-no-files-found: error

- name: Upload @bot-whatsapp/cli
uses: actions/upload-artifact@master
with:
name: dist-dev-cli
path: packages/cli/lib/
if-no-files-found: error

- name: Upload @bot-whatsapp/create-bot-whatsapp
uses: actions/upload-artifact@master
with:
name: dist-dev-create-bot-whatsapp
path: packages/create-bot-whatsapp/lib/
if-no-files-found: error

- name: Upload @bot-whatsapp/database
uses: actions/upload-artifact@master
with:
name: dist-dev-database
path: packages/database/lib/
if-no-files-found: error

- name: Upload @bot-whatsapp/database
uses: actions/upload-artifact@master
with:
name: dist-dev-provider
path: packages/provider/lib/
if-no-files-found: error

- name: Build Eslint rules
run: yarn lint:fix

############ RELEASE ############
release:
name: Release
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
needs:
- build-package
- test-unit

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.2.4
with:
version: 7

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'pnpm'
registry-url: https://registry.npmjs.org/

- run: corepack enable

- name: Download Build Artifacts
uses: actions/download-artifact@v2

- name: Print Distribution Artifacts
run: tree builderio-qwik-distribution/

- name: Print Create Qwik CLI Artifacts
run: tree dist-dev-create-qwik/

- name: Move Distribution Artifacts
run: |
mkdir -p packages/qwik/dist/
mv builderio-qwik-distribution/* packages/qwik/dist/
mkdir -p packages/create-qwik/dist/
mv dist-dev-create-qwik/* packages/create-qwik/dist/
mkdir -p packages/eslint-plugin-qwik/dist/
mv dist-dev-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/
- name: Install NPM Dependencies
run: pnpm install --frozen-lockfile

- name: Dry-Run Publish @builder.io/qwik
if: ${{ github.event_name != 'workflow_dispatch' }}
run: pnpm tsm scripts/index.ts --set-dist-tag="${{ github.event.inputs.disttag }}" --release --dry-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @builder.io/qwik
if: ${{ github.event_name == 'workflow_dispatch' }}
run: pnpm tsm scripts/index.ts --set-dist-tag="${{ github.event.inputs.disttag }}" --release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Save artifacts
if: ${{ needs.changes.outputs.fullbuild == 'true' && github.event_name == 'push' }}
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: pnpm run qwik-save-artifacts

############ UNIT TEST ############
test-unit:
name: Unit Tests
runs-on: ubuntu-latest
needs:
- build-package

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 16.x
cache: 'yarn'
registry-url: https://registry.npmjs.org/

- run: corepack enable

- name: Install NPM Dependencies
run: yarn install --immutable --network-timeout 300000
- name: Test

- name: Unit Tests
run: yarn test
26 changes: 0 additions & 26 deletions .github/workflows/relases.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ coverage/
log
log/*
*.log
*.tgz
lib
tmp/
.yarn/*
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"rollup": "^3.2.3",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-copy": "^3.4.0",
"semver": "^7.3.8",
"standard-version": "^9.5.0",
"uvu": "^0.5.6"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/bot/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "@bot-whatsapp/bot",
"version": "0.0.1",
"version": "0.0.4-alpha.0",
"description": "",
"main": "./lib/bundle.bot.cjs",
"private": true,
"scripts": {
"bot:rollup": "node ../../node_modules/.bin/rollup index.js --config ./rollup-cli.config.js",
"format:check": "prettier --check .",
Expand Down
2 changes: 1 addition & 1 deletion packages/bot/provider/provider.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ProviderClass extends EventEmitter {
*
*/

sendMessage = async (userId, message, sendMessage) => {
sendMessage = async (userId, message) => {
if (NODE_ENV !== 'production')
console.log('[sendMessage]', { userId, message })
return message
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "@bot-whatsapp/cli",
"version": "0.0.1",
"version": "0.0.2-alpha.0",
"description": "",
"main": "index.js",
"private": true,
"devDependencies": {
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/create-bot-whatsapp/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "create-bot-whatsapp",
"version": "0.0.1",
"version": "0.0.9-alpha.0",
"description": "",
"main": "./lib/bin/bundle.create.cjs",
"private": true,
"dependencies": {
"@bot-whatsapp/cli": "*"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/database/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "@bot-whatsapp/database",
"version": "0.0.1",
"version": "0.0.2-alpha.0",
"description": "Esto es el conector a mysql, pg, mongo",
"main": "./lib/mock/index.cjs",
"private": true,
"keywords": [],
"author": "",
"license": "ISC",
Expand Down
34 changes: 17 additions & 17 deletions packages/docs/adaptors/cloudflare-pages/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { cloudflarePagesAdaptor } from '@builder.io/qwik-city/adaptors/cloudflare-pages/vite';
import { extendConfig } from '@builder.io/qwik-city/vite';
import baseConfig from '../../vite.config';
import { cloudflarePagesAdaptor } from '@builder.io/qwik-city/adaptors/cloudflare-pages/vite'
import { extendConfig } from '@builder.io/qwik-city/vite'
import baseConfig from '../../vite.config'

export default extendConfig(baseConfig, () => {
return {
build: {
ssr: true,
rollupOptions: {
input: ['src/entry.cloudflare-pages.tsx', '@qwik-city-plan'],
},
},
plugins: [
cloudflarePagesAdaptor({
staticGenerate: true,
}),
],
};
});
return {
build: {
ssr: true,
rollupOptions: {
input: ['src/entry.cloudflare-pages.tsx', '@qwik-city-plan'],
},
},
plugins: [
cloudflarePagesAdaptor({
staticGenerate: true,
}),
],
}
})
2 changes: 1 addition & 1 deletion packages/docs/functions/[[path]].ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

// Cloudflare Pages Functions
// https://developers.cloudflare.com/pages/platform/functions/
export { onRequest } from '../server/entry.cloudflare-pages';
export { onRequest } from '../server/entry.cloudflare-pages'
8 changes: 4 additions & 4 deletions packages/docs/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
14 changes: 7 additions & 7 deletions packages/docs/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
"name": "qwik-project-name",
"short_name": "Welcome to Qwik",
"start_url": ".",
"display": "standalone",
"background_color": "#fff",
"description": "A Qwik project app."
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
"name": "qwik-project-name",
"short_name": "Welcome to Qwik",
"start_url": ".",
"display": "standalone",
"background_color": "#fff",
"description": "A Qwik project app."
}
22 changes: 11 additions & 11 deletions packages/docs/src/components/breadcrumbs/breadcrumbs.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
nav.breadcrumbs {
padding: 5px;
border-bottom: 1px solid #ddd;
padding: 5px;
border-bottom: 1px solid #ddd;
}

nav.breadcrumbs > span {
display: inline-block;
padding: 5px 0;
font-size: 12px;
display: inline-block;
padding: 5px 0;
font-size: 12px;
}

nav.breadcrumbs > span a {
text-decoration: none;
color: inherit;
text-decoration: none;
color: inherit;
}

nav.breadcrumbs > span::after {
content: '>';
padding: 0 5px;
opacity: 0.4;
content: '>';
padding: 0 5px;
opacity: 0.4;
}

nav.breadcrumbs > span:last-child::after {
display: none;
display: none;
}

0 comments on commit e5a9db7

Please sign in to comment.