CI/CD & Publishing
CI/CD & Publishing
Moltext leverages GitHub Actions to maintain a robust delivery pipeline, ensuring that the documentation compiler remains stable and accessible for both human developers and autonomous agents. The automation focuses on code integrity, type safety, and seamless distribution to the NPM registry.
Continuous Integration (CI)
The CI suite is triggered automatically on every push to the main branch and for all Pull Requests. This pipeline ensures that any changes to the crawler or processor do not break the "Agent-Native" deterministic output.
The CI workflow performs the following steps:
- Dependency Management: Executes
npm cito ensure a consistent build environment based on thepackage-lock.json. - TypeScript Compilation: Validates that the source code in
src/compiles without errors, maintaining the integrity of theProcessorandCrawlerclasses. - Linting: Runs static analysis to enforce the codebase's structural standards.
- Automated Testing: Executes unit and integration tests (where applicable) to verify that HTML cleaning and Markdown normalization logic perform as expected across different documentation structures.
Continuous Delivery (CD)
The CD pipeline automates the release process, ensuring that the latest version of the moltext CLI is available via NPM as soon as a new version is validated.
Automated NPM Publishing
Upon the creation of a new GitHub Release or the pushing of a version tag (e.g., v1.0.0), the publishing workflow:
- Authenticates: Securely connects to the NPM registry using a repository-level
NPM_TOKEN. - Builds Production Assets: Compiles the final JavaScript distribution files.
- Publishes: Executes
npm publish --access public, making the global commandnpm install -g moltextimmediately available to the community.
Environment & Secrets Configuration
For contributors managing the repository, the following secrets are required within the GitHub Actions environment to maintain the pipeline:
| Secret | Purpose |
| :--- | :--- |
| NPM_TOKEN | Required for automated publishing to the NPM registry. |
| OPENAI_API_KEY | (Optional) Used for running integration tests that verify LLM-enhanced processing logic. |
Local Build & Verification
Before submitting a Pull Request, you can simulate the CI environment locally to ensure your changes meet the project's standards:
# Install dependencies
npm install
# Run the TypeScript compiler to check for type errors
npm run build
# Link the package locally to test the 'moltext' command
npm link
Once linked, you can verify the CLI's behavior using the local build:
moltext https://docs.example.com --raw -o test-output.md