@reldens/skills 0.56.0 → 0.59.0

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,140 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ inputs:
8
+ ref:
9
+ description: 'Tag, branch or commit to publish'
10
+ required: true
11
+ default: 'master'
12
+ dist_tag:
13
+ description: 'npm dist-tag (latest for stable, next for prereleases)'
14
+ required: false
15
+ default: ''
16
+ dry_run:
17
+ description: 'Validate and pack only, do not publish'
18
+ type: boolean
19
+ required: false
20
+ default: false
21
+
22
+ permissions:
23
+ contents: read
24
+ id-token: write
25
+
26
+ concurrency:
27
+ group: npm-publish-${{ github.repository }}
28
+ cancel-in-progress: false
29
+
30
+ jobs:
31
+ publish:
32
+ name: Validate, test and publish
33
+ runs-on: ubuntu-latest
34
+ timeout-minutes: 20
35
+ steps:
36
+ - name: Checkout the released source
37
+ uses: actions/checkout@v4
38
+ with:
39
+ ref: ${{ github.event.inputs.ref || github.ref }}
40
+
41
+ - name: Set up Node.js
42
+ uses: actions/setup-node@v4
43
+ with:
44
+ node-version: '24'
45
+ registry-url: 'https://registry.npmjs.org'
46
+
47
+ - name: Ensure an npm version with trusted publishing support
48
+ run: |
49
+ NPM_VERSION=$(npm --version)
50
+ echo "Runner has npm $NPM_VERSION on node $(node --version)"
51
+ NPM_MAJOR=${NPM_VERSION%%.*}
52
+ if [ "$NPM_MAJOR" -lt 11 ]; then
53
+ npm install -g npm@11
54
+ echo "Upgraded to npm $(npm --version)"
55
+ fi
56
+
57
+ - name: Read package metadata
58
+ id: meta
59
+ run: |
60
+ PKG_NAME=$(node -p "require('./package.json').name")
61
+ PKG_VERSION=$(node -p "require('./package.json').version")
62
+ PKG_PRIVATE=$(node -p "String(require('./package.json').private === true)")
63
+ echo "name=$PKG_NAME" >> "$GITHUB_OUTPUT"
64
+ echo "version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
65
+ echo "private=$PKG_PRIVATE" >> "$GITHUB_OUTPUT"
66
+ echo "Publishing candidate: $PKG_NAME@$PKG_VERSION"
67
+
68
+ - name: Reject private packages
69
+ if: steps.meta.outputs.private == 'true'
70
+ run: |
71
+ echo "::error::${{ steps.meta.outputs.name }} is marked private and must not be published."
72
+ exit 1
73
+
74
+ - name: Check the release tag matches the package version
75
+ if: github.event_name == 'release'
76
+ run: |
77
+ TAG_VERSION="${{ github.event.release.tag_name }}"
78
+ TAG_VERSION="${TAG_VERSION#v}"
79
+ if [ "$TAG_VERSION" != "${{ steps.meta.outputs.version }}" ]; then
80
+ echo "::error::Release tag $TAG_VERSION does not match package.json version ${{ steps.meta.outputs.version }}."
81
+ exit 1
82
+ fi
83
+
84
+ - name: Check the version is not published yet
85
+ run: |
86
+ PUBLISHED=$(npm view "${{ steps.meta.outputs.name }}@${{ steps.meta.outputs.version }}" version --registry=https://registry.npmjs.org/ --prefer-online 2>/dev/null || true)
87
+ if [ -n "$PUBLISHED" ]; then
88
+ echo "::error::${{ steps.meta.outputs.name }}@${{ steps.meta.outputs.version }} already exists on npm. Bump the version, published versions are immutable."
89
+ exit 1
90
+ fi
91
+
92
+ - name: Resolve the dist-tag
93
+ id: disttag
94
+ run: |
95
+ DIST_TAG="${{ github.event.inputs.dist_tag }}"
96
+ if [ -z "$DIST_TAG" ]; then
97
+ DIST_TAG="latest"
98
+ case "${{ steps.meta.outputs.version }}" in
99
+ *-*) DIST_TAG="next" ;;
100
+ esac
101
+ fi
102
+ echo "value=$DIST_TAG" >> "$GITHUB_OUTPUT"
103
+ echo "Using dist-tag: $DIST_TAG"
104
+
105
+ - name: Install dependencies
106
+ run: npm ci
107
+
108
+ - name: Run tests
109
+ env:
110
+ RELDENS_LOG_LEVEL: '9'
111
+ run: npm test --if-present
112
+
113
+ - name: Pack only (dry run)
114
+ if: github.event.inputs.dry_run == 'true'
115
+ run: |
116
+ npm publish --dry-run --access public --tag "${{ steps.disttag.outputs.value }}"
117
+ echo "Dry run finished, nothing was published."
118
+
119
+ - name: Publish to npm with trusted publishing
120
+ if: github.event.inputs.dry_run != 'true'
121
+ run: npm publish --access public --tag "${{ steps.disttag.outputs.value }}"
122
+
123
+ - name: Confirm the published version
124
+ if: github.event.inputs.dry_run != 'true'
125
+ run: |
126
+ PKG_NAME="${{ steps.meta.outputs.name }}"
127
+ PKG_VERSION="${{ steps.meta.outputs.version }}"
128
+ DIST_TAG="${{ steps.disttag.outputs.value }}"
129
+ for ATTEMPT in 1 2 3 4 5 6 7 8 9 10; do
130
+ FOUND=$(npm view "$PKG_NAME@$PKG_VERSION" version --registry=https://registry.npmjs.org/ --prefer-online --loglevel=error 2>/dev/null || true)
131
+ TAGGED=$(npm view "$PKG_NAME" "dist-tags.$DIST_TAG" --registry=https://registry.npmjs.org/ --prefer-online --loglevel=error 2>/dev/null || true)
132
+ if [ "$FOUND" = "$PKG_VERSION" ] && [ "$TAGGED" = "$PKG_VERSION" ]; then
133
+ echo "Confirmed on the registry: $PKG_NAME@$PKG_VERSION with dist-tag $DIST_TAG."
134
+ exit 0
135
+ fi
136
+ echo "Attempt $ATTEMPT: $PKG_NAME@$PKG_VERSION is not on the registry yet, the dist-tag $DIST_TAG points to [${TAGGED:-none}]. Retry in 60s."
137
+ sleep 60
138
+ done
139
+ echo "::error::$PKG_NAME@$PKG_VERSION with dist-tag $DIST_TAG was not confirmed on the registry after 10 minutes. Check https://www.npmjs.com/package/$PKG_NAME before releasing again, published versions are immutable."
140
+ exit 1
@@ -0,0 +1,36 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [develop, master]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: tests-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ tests:
17
+ name: tests
18
+ runs-on: ubuntu-latest
19
+ timeout-minutes: 20
20
+ steps:
21
+ - name: Checkout the source
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Set up Node.js
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: '24'
28
+ cache: npm
29
+
30
+ - name: Install dependencies
31
+ run: npm ci
32
+
33
+ - name: Run tests
34
+ env:
35
+ RELDENS_LOG_LEVEL: '9'
36
+ run: npm test