@decibeltrade/sdk 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,20 +7,52 @@ on:
7
7
  workflow_dispatch:
8
8
 
9
9
  permissions:
10
- id-token: write # Required for OIDC
11
10
  contents: read
11
+ id-token: write # required for npm OIDC
12
12
 
13
13
  jobs:
14
14
  publish:
15
15
  runs-on: ubuntu-latest
16
+
16
17
  steps:
17
18
  - uses: actions/checkout@v4
18
19
 
19
20
  - uses: actions/setup-node@v4
20
21
  with:
21
- node-version: '24'
22
- registry-url: 'https://registry.npmjs.org'
23
- - run: npm install
24
- - run: npm run build --if-present
25
- - run: npm test
26
- - run: npm publish
22
+ node-version: "24"
23
+ registry-url: "https://registry.npmjs.org"
24
+
25
+ - name: Check npm version
26
+ id: version
27
+ run: |
28
+ PKG_NAME=$(node -p "require('./package.json').name")
29
+ LOCAL=$(node -p "require('./package.json').version")
30
+ REMOTE=$(npm view "$PKG_NAME" version || echo "0.0.0")
31
+
32
+ echo "📦 Package: $PKG_NAME"
33
+ echo "📄 Local version: $LOCAL"
34
+ echo "🌐 Published version: $REMOTE"
35
+
36
+ if npx semver "$LOCAL" -r ">$REMOTE" >/dev/null; then
37
+ echo "publish=true" >> "$GITHUB_OUTPUT"
38
+ echo "✅ Version is greater — will publish"
39
+ else
40
+ echo "publish=false" >> "$GITHUB_OUTPUT"
41
+ echo "⏭️ Version not greater — skipping publish"
42
+ fi
43
+
44
+ - name: Install dependencies
45
+ if: steps.version.outputs.publish == 'true'
46
+ run: npm install
47
+
48
+ - name: Build
49
+ if: steps.version.outputs.publish == 'true'
50
+ run: npm run build --if-present
51
+
52
+ - name: Test
53
+ if: steps.version.outputs.publish == 'true'
54
+ run: npm test --if-present
55
+
56
+ - name: Publish to npm
57
+ if: steps.version.outputs.publish == 'true'
58
+ run: npm publish --access public
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  },
44
44
  "type": "module",
45
45
  "types": "dist/index.d.ts",
46
- "version": "0.2.6"
46
+ "version": "0.2.7"
47
47
  }