Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
pull_request:
push:
branches:
- main
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build
35 changes: 35 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy and Publish to npmjs

on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Publish to npmjs
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,21 @@ const result = await ixc.delete("cliente", { id: "123" });

Os endpoints/tabelas e payloads dependem da documentação oficial do IXC Soft:
https://wikiapiprovedor.ixcsoft.com.br/#

## Publicação automática no npmjs (GitHub Actions)

Foi adicionado workflow em `.github/workflows/publish-npm.yml`.

### Como configurar

1. No GitHub do repositório, configure o secret:
- `NPM_TOKEN`: token de automação do npmjs com permissão de publish.
2. Faça commit com versão atualizada no `package.json`.
3. Crie e envie uma tag semântica:

```bash
git tag v1.1.1
git push origin v1.1.1
```

Ao subir a tag `v*.*.*`, o workflow executa `npm ci`, `npm run build` e `npm publish`.