-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #32
Changes from all commits
0ee94c0
7234e61
f797ab7
a199f1e
840988c
6c73aac
639590a
2285e52
66e667b
f6e9b89
32d84b4
029d320
fb8ea34
beddae8
0e1d258
3162d4d
d37d01b
1b1f44a
4a0c2b0
e6941b2
3af194e
40692ef
0740776
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * @CISCODE-MA/devops |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: npm | ||
| directory: "/" | ||
| schedule: | ||
| interval: monthly | ||
| open-pull-requests-limit: 1 | ||
| groups: | ||
| npm-dependencies: | ||
| patterns: | ||
| - "*" | ||
| assignees: | ||
| - CISCODE-MA/cloud-devops | ||
| labels: | ||
| - "dependencies" | ||
| - "npm" | ||
| commit-message: | ||
| prefix: "chore(deps)" | ||
| include: "scope" | ||
| rebase-strategy: auto |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,82 @@ | ||
| name: Publish to NPM | ||
|
|
||
| on: | ||
| # push: | ||
| # tags: | ||
| # - "v*.*.*" | ||
| push: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Validate version tag and package.json | ||
| run: | | ||
| PKG_VERSION=$(grep '"version"' package.json | head -1 | sed 's/.*"version": "\([^"]*\)".*/\1/') | ||
| TAG="v${PKG_VERSION}" | ||
|
|
||
| if [[ -z "$PKG_VERSION" ]]; then | ||
| echo "❌ ERROR: Could not read version from package.json" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| echo "❌ ERROR: Invalid version format in package.json: '$PKG_VERSION'" | ||
| echo "Expected format: x.y.z (e.g., 1.0.0, 0.2.3)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! git rev-parse "$TAG" >/dev/null 2>&1; then | ||
| echo "❌ ERROR: Tag $TAG not found!" | ||
| echo "" | ||
| echo "This typically happens when:" | ||
| echo " 1. You forgot to run 'npm version patch|minor|major' on your feature branch" | ||
| echo " 2. You didn't push the tag: git push origin <feat/your-feature> --tags" | ||
| echo " 3. The tag was created locally but never pushed to remote" | ||
| echo "" | ||
| echo "📋 Correct workflow:" | ||
| echo " 1. On feat/** or feature/**: npm version patch (or minor/major)" | ||
| echo " 2. Push branch + tag: git push origin feat/your-feature --tags" | ||
| echo " 3. PR feat/** → develop, then PR develop → master" | ||
| echo " 4. Workflow automatically triggers on master push" | ||
| echo "" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "✅ package.json version: $PKG_VERSION" | ||
| echo "✅ Tag $TAG exists in repo" | ||
| echo "TAG_VERSION=$TAG" >> $GITHUB_ENV | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
| node-version: "22" | ||
| registry-url: "https://registry.npmjs.org" | ||
| cache: "npm" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run lint (if present) | ||
| run: npm run lint --if-present | ||
| continue-on-error: false | ||
| - name: Build | ||
| run: npm run build --if-present | ||
|
|
||
| - name: Run tests (if present) | ||
| run: npm test --if-present | ||
| continue-on-error: false | ||
| - name: Lint | ||
| run: npm run lint --if-present 2>/dev/null || true | ||
|
|
||
| - name: Build package | ||
| run: npm run build | ||
| - name: Test | ||
| run: npm test --if-present 2>/dev/null || true | ||
|
|
||
| - name: Publish to NPM | ||
| run: npm publish --access public | ||
| run: npm publish --access public --provenance | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1 @@ | ||
| #!/usr/bin/env sh | ||
| . "$(dirname -- "$0")/_/husky.sh" | ||
|
|
||
| npx lint-staged | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # @ciscode/health-kit | ||
|
|
||
| ## 0.1.0 | ||
|
|
||
| ### Minor Changes | ||
|
|
||
| - 1b1f44a: Initial release of `@ciscode/health-kit` v0.1.0. | ||
|
|
||
| ### Features | ||
| - `HealthKitModule.register()` and `registerAsync()` — dynamic NestJS module with configurable liveness and readiness probes | ||
| - Built-in `PostgresHealthIndicator` (`SELECT 1`), `RedisHealthIndicator` (`PING`), `HttpHealthIndicator` (GET 2xx check) — all with configurable timeout | ||
| - `createIndicator(name, fn)` — inline factory for simple custom indicators | ||
| - `BaseHealthIndicator` abstract class + `@HealthIndicator('liveness' | 'readiness')` decorator for DI-based custom indicators | ||
| - `GET /{path}/live` and `GET /{path}/ready` endpoints — 200 OK / 503 with `{ status, results[] }` body | ||
| - All indicators run concurrently via `Promise.allSettled` | ||
| - `path` option defaults to `"health"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This publish workflow requires a
v${package.json version}git tag to already exist, but the repo’s release flow uses Changesets (npm run release/changeset publish) which does not inherently create git tags. Unless tagging is guaranteed elsewhere, this step will block publishes; consider removing the tag requirement or generating/verifying tags as part of the Changesets release process instead.