mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-17 19:26:23 +00:00
ci(ci): ⚡ update ci
This commit is contained in:
107
.github/workflows/ci.yml
vendored
107
.github/workflows/ci.yml
vendored
@@ -14,6 +14,8 @@ jobs:
|
||||
build-package:
|
||||
name: Build Package
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- test-unit
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@@ -33,44 +35,6 @@ jobs:
|
||||
- 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
|
||||
|
||||
@@ -78,76 +42,49 @@ jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs:
|
||||
- build-package
|
||||
- test-unit
|
||||
|
||||
steps:
|
||||
- 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'
|
||||
cache: 'yarn'
|
||||
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
|
||||
run: yarn install --immutable --network-timeout 300000
|
||||
|
||||
- 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: Build Package
|
||||
run: yarn build
|
||||
|
||||
- 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: Release @bot-whatsapp/bot
|
||||
run: yarn node ./scripts/release.js --name=bot --version= --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
|
||||
- name: Release @bot-whatsapp/cli
|
||||
run: yarn node ./scripts/release.js --name=cli --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/create-bot-whatsapp
|
||||
run: yarn node ./scripts/release.js --name=create-bot-whatsapp --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/create-bot-whatsapp
|
||||
run: yarn node ./scripts/release.js --name=create-bot-whatsapp --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/database
|
||||
run: yarn node ./scripts/release.js --name=database --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/provider
|
||||
run: yarn node ./scripts/release.js --name=provider --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
############ UNIT TEST ############
|
||||
test-unit:
|
||||
name: Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build-package
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
Reference in New Issue
Block a user