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
16 changes: 10 additions & 6 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
name: publish-sdk
permissions:
contents: read
packages: write # npm publish uploads the package to GitHub Packages
runs-on: ubuntu-latest
needs: [release-please, gate]
if: needs.release-please.outputs.sdk-release-created == 'true'
Expand All @@ -65,24 +66,26 @@ jobs:
with:
node-version-file: '.node-version'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
registry-url: 'https://npm.pkg.github.com'
scope: '@aignostics'

- name: Install dependencies
run: npm ci

- name: Build SDK
run: npm run build:sdk

- name: Publish SDK to npm
- name: Publish SDK to GitHub Packages
working-directory: packages/sdk
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-cli:
name: publish-cli
permissions:
contents: read
packages: write # npm publish uploads the package to GitHub Packages
runs-on: ubuntu-latest
needs: [release-please, gate]
if: needs.release-please.outputs.cli-release-created == 'true'
Expand All @@ -102,16 +105,17 @@ jobs:
with:
node-version-file: '.node-version'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
registry-url: 'https://npm.pkg.github.com'
scope: '@aignostics'

- name: Install dependencies
run: npm ci

- name: Build CLI
run: npm run build:cli

- name: Publish CLI to npm
- name: Publish CLI to GitHub Packages
working-directory: packages/cli
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
@aignostics:registry=https://registry.npmjs.org/
# @aignostics packages are published to GitHub Packages. Installing them needs
# a GitHub token with read:packages in your user-level ~/.npmrc:
# //npm.pkg.github.com/:_authToken=<token>
@aignostics:registry=https://npm.pkg.github.com/
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ For general information about the Aignostics Platform [check this documentation

## Installation

Both packages are published to GitHub Packages, and only members of the aignostics GitHub organisation can install them. Add the registry and a GitHub token with the `read:packages` scope to your user-level `~/.npmrc`:

```ini
@aignostics:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=<github-token>
```

With the GitHub CLI, `gh auth refresh -s read:packages` adds the scope to your login and `gh auth token` prints the token.

### SDK Package

```bash
Expand Down
12 changes: 6 additions & 6 deletions docs/SOFTWARE_ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The Aignostics TypeScript SDK Repository provides TypeScript developers with too
| **CLI Users** | Interactive tool for platform operations without coding |
| **Platform Engineers** | Maintainable codebase aligned with API evolution |
| **Security Teams** | Secure token management and authentication flows |
| **DevOps** | Reliable testing, clear build pipeline, npm publishing |
| **DevOps** | Reliable testing, clear build pipeline, package publishing |

---

Expand All @@ -70,7 +70,7 @@ The Aignostics TypeScript SDK Repository provides TypeScript developers with too
| **TypeScript Strict Mode** | Enforces type safety across codebase |
| **OpenAPI Specification** | External dependency from Platform API (staging endpoint) |
| **Docker** | Required for OpenAPI code generation (v7.14.0) |
| **npm Registry** | Packages published to public npm registry |
| **GitHub Packages** | Packages published to the aignostics organisation's npm registry on GitHub Packages, readable only by organisation members |
| **Turborepo** | Workspace orchestration and build caching |

### 2.2 Organizational Constraints
Expand Down Expand Up @@ -102,7 +102,7 @@ graph LR
subgraph "External Systems"
API[Aignostics Platform API]
AUTH[Auth0 OIDC Provider]
NPM[npm Registry]
NPM[GitHub Packages npm registry]
KEYCHAIN[OS Keychain/Credential Manager]
end

Expand Down Expand Up @@ -133,7 +133,7 @@ graph LR
| **Aignostics Platform API** | REST (JSON/HTTP) | AI model execution, data retrieval |
| **Auth0** | OAuth2/OIDC | User authentication, token issuance |
| **OS Keychain** | Native API | Secure token storage |
| **npm Registry** | HTTP | Package distribution |
| **GitHub Packages** | HTTP (npm registry) | Package distribution |

### 3.2 Technical Context

Expand Down Expand Up @@ -549,7 +549,7 @@ graph TB
CLI_DIST[cli/dist/]
end

subgraph "npm Registry"
subgraph "GitHub Packages"
SDK_PKG[SDK Package]
CLI_PKG[CLI Package]
end
Expand Down Expand Up @@ -818,7 +818,7 @@ graph LR
- Release PR opened per package (`sdk`, `cli`), kept up to date as commits land
- Version bumped, `CHANGELOG.md` generated, and `package.json` updated on PR merge
- Git tags and GitHub Releases created (independent package versions)
- npm publish (independent package versions)
- npm publish to GitHub Packages (independent package versions)

---

Expand Down
2 changes: 2 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Command-line interface for the Aignostics Platform.

## Installation

The package is published to GitHub Packages. Set up the registry and a token first, as described in the [repository README](https://github.com/aignostics/typescript-sdk#installation).

```bash
npm install -g @aignostics/cli
```
Expand Down
9 changes: 7 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@
"LICENSE"
],
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
"registry": "https://npm.pkg.github.com",
"access": "restricted"
},
"repository": {
"type": "git",
"url": "git+https://github.com/aignostics/typescript-sdk.git",
"directory": "packages/cli"
},
"scripts": {
"build": "tsdown",
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The TypeScript SDK for the Aignostics Platform.

## Installation

The package is published to GitHub Packages. Set up the registry and a token first, as described in the [repository README](https://github.com/aignostics/typescript-sdk#installation).

```bash
npm install @aignostics/sdk
```
Expand Down
9 changes: 7 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
"LICENSE"
],
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
"registry": "https://npm.pkg.github.com",
"access": "restricted"
},
"repository": {
"type": "git",
"url": "git+https://github.com/aignostics/typescript-sdk.git",
"directory": "packages/sdk"
},
"scripts": {
"build": "tsdown",
Expand Down