@agility/management-sdk 0.1.38 → 0.1.40

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.
@@ -0,0 +1,61 @@
1
+ name: Publish to npm
2
+
3
+ # Publishes @agility/management-sdk to npm when a version tag (vX.Y.Z) is pushed.
4
+ #
5
+ # Release flow:
6
+ # 1. Bump "version" in package.json and merge to main.
7
+ # 2. Tag the commit: `git tag v0.1.40 && git push origin v0.1.40`
8
+ # 3. This workflow verifies the tag matches package.json, builds, and publishes.
9
+
10
+ on:
11
+ push:
12
+ tags:
13
+ - "v*"
14
+
15
+ jobs:
16
+ publish:
17
+ name: Build and publish to npm
18
+ runs-on: ubuntu-latest
19
+ permissions:
20
+ contents: read
21
+ id-token: write # required for npm Trusted Publisher (OIDC) provenance
22
+
23
+ steps:
24
+ - name: Checkout
25
+ uses: actions/checkout@v4
26
+ with:
27
+ fetch-depth: 0
28
+
29
+ - name: Verify tag matches package.json version
30
+ run: |
31
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
32
+ PKG_VERSION=$(node -p "require('./package.json').version")
33
+ if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
34
+ echo "Tag ($TAG_VERSION) does not match package.json version ($PKG_VERSION)."
35
+ exit 1
36
+ fi
37
+
38
+ - name: Set up Node.js
39
+ uses: actions/setup-node@v4
40
+ with:
41
+ node-version: "24"
42
+ registry-url: "https://registry.npmjs.org"
43
+
44
+ - name: Upgrade npm for Trusted Publisher OIDC support
45
+ run: npm install -g npm@latest
46
+
47
+ - name: Install dependencies
48
+ run: npm ci
49
+
50
+ - name: Build
51
+ run: npm run build
52
+
53
+ - name: Publish
54
+ run: |
55
+ PKG_VERSION=$(node -p "require('./package.json').version")
56
+ PRERELEASE_TAG=$(echo "$PKG_VERSION" | grep -oP '(?<=-)\w+' | head -1 || true)
57
+ if [ -n "$PRERELEASE_TAG" ]; then
58
+ npm publish --access public --provenance --tag "$PRERELEASE_TAG"
59
+ else
60
+ npm publish --access public --provenance
61
+ fi