Skip to content
Open
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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ on:
jobs:
build-test:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
Comment thread
cs-raj marked this conversation as resolved.
steps:
- uses: actions/checkout@v3
- uses: ArtiomTr/jest-coverage-report-action@v2
- uses: ArtiomTr/jest-coverage-report-action@7f750dd50f5585533321eb7ebc482b936b49a5d4 # v2
id: coverage-utils-js
with:
output: comment, report-markdown
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/npm-publish.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Publish package to npmjs registry
on:
release:
types: [published]
Comment thread
cs-raj marked this conversation as resolved.

jobs:
publish-npm:
if: ${{ startsWith(github.event.release.tag_name, 'v') && !github.event.release.draft }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name }}
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: 24
registry-url: https://registry.npmjs.org/
cache: 'npm'
- name: Check the release tag matches package.json
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
PKG_VERSION="v$(node -p "require('./package.json').version")"
if [ "$RELEASE_TAG" != "$PKG_VERSION" ]; then
echo "::error::release tag $RELEASE_TAG does not match package.json version $PKG_VERSION"
exit 1
fi
- run: npm ci
- name: Update npm
run: npm install -g npm@latest
- name: Release
run: npm publish --access public --tag ${{ github.event.release.prerelease && 'beta' || 'latest' }}

publish-github:
if: ${{ startsWith(github.event.release.tag_name, 'v') && !github.event.release.draft }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name }}
persist-credentials: false
- uses: actions/setup-node@v7
with:
node-version: 24
registry-url: https://npm.pkg.github.com/
cache: 'npm'
- name: Check the release tag matches package.json
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
PKG_VERSION="v$(node -p "require('./package.json').version")"
if [ "$RELEASE_TAG" != "$PKG_VERSION" ]; then
echo "::error::release tag $RELEASE_TAG does not match package.json version $PKG_VERSION"
exit 1
fi
- run: npm ci
- name: Update npm
run: npm install -g npm@latest
- name: Release
run: npm publish --access public --tag ${{ github.event.release.prerelease && 'beta' || 'latest' }}
env:
NODE_AUTH_TOKEN: ${{ github.token }}
6 changes: 5 additions & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ fileignoreconfig:
- filename: .github/workflows/secrets-scan.yml
ignore_detectors:
- filecontent
- filename: .github/workflows/ci.yml
checksum: 14991153c5531029f3ac14dbce6fab70aa4b654d445a3514083d446bfadc8813
Comment thread
cs-raj marked this conversation as resolved.
- filename: package-lock.json
checksum: 8e62821551e64c0fbd23ce2951b44e41561196f0d38b6a2da7de1f6921b48865
ignore_detectors:
- filecontent
- base64content
Comment thread
cs-raj marked this conversation as resolved.
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ npm run download-regions # regions.json only (also run as part of prebuild)

`npm test` runs **`pretest` → `npm run build`**, then Jest with coverage; outputs under **`reports/`**. Use **`npm run test:debug`** for Jest watch mode (`--runInBand`).

**CI:** `.github/workflows/ci.yml` (unit tests / coverage on `development`, `master`). Publish: `.github/workflows/npm-publish.yml` (GitHub **Release** created for tag `v*`; draft releases are skipped). Back-merge automation: `.github/workflows/back-merge-pr.yml`.
**CI:** `.github/workflows/ci.yml` (unit tests / coverage on `development`, `master`). Publish: `.github/workflows/release.yml` (runs when a GitHub **Release** is published for tag `v*`; drafts are skipped) — npm through OIDC trusted publishing, GitHub Packages with the job token. Back-merge automation: `.github/workflows/back-merge-pr.yml`.

Install: `npm i @contentstack/utils` — see root **`README.md`** and **`package.json`** for the current version.

Expand Down
Loading
Loading