@gerdloos/npm-trusts-github-skill 1.0.0 → 1.0.3
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.
- package/.github/workflows/publish.yml +50 -6
- package/README.md +12 -1
- package/package.json +18 -3
|
@@ -1,22 +1,66 @@
|
|
|
1
|
-
name: Publish to npm
|
|
1
|
+
name: Publish to npm and create release
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
4
|
+
workflow_dispatch:
|
|
7
5
|
|
|
8
6
|
permissions:
|
|
9
7
|
id-token: write
|
|
10
|
-
contents:
|
|
8
|
+
contents: write
|
|
11
9
|
|
|
12
10
|
jobs:
|
|
13
11
|
publish:
|
|
14
12
|
runs-on: ubuntu-latest
|
|
15
13
|
steps:
|
|
16
14
|
- uses: actions/checkout@v4
|
|
15
|
+
|
|
17
16
|
- uses: actions/setup-node@v4
|
|
18
17
|
with:
|
|
19
18
|
node-version: '22'
|
|
20
19
|
registry-url: 'https://registry.npmjs.org'
|
|
20
|
+
|
|
21
21
|
- run: npm install -g npm@latest
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
- name: Read package info
|
|
24
|
+
id: pkg
|
|
25
|
+
run: |
|
|
26
|
+
NAME=$(node -p "require('./package.json').name")
|
|
27
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
28
|
+
echo "name=${NAME}" >> $GITHUB_OUTPUT
|
|
29
|
+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
30
|
+
|
|
31
|
+
- name: Validate version is new on npm
|
|
32
|
+
run: |
|
|
33
|
+
if npm view "${{ steps.pkg.outputs.name }}@${{ steps.pkg.outputs.version }}" version >/dev/null 2>&1; then
|
|
34
|
+
echo "::error::Version ${{ steps.pkg.outputs.version }} already exists on npm"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
- name: Check tag does not exist
|
|
39
|
+
run: |
|
|
40
|
+
TAG="v${{ steps.pkg.outputs.version }}"
|
|
41
|
+
git fetch --tags
|
|
42
|
+
if git rev-parse "${TAG}" >/dev/null 2>&1; then
|
|
43
|
+
echo "::error::Tag ${TAG} already exists"
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
- name: Pack
|
|
48
|
+
id: pack
|
|
49
|
+
run: |
|
|
50
|
+
npm pack --pack-destination /tmp
|
|
51
|
+
echo "tarball=/tmp/$(ls /tmp/*.tgz | xargs -n1 basename)" >> $GITHUB_OUTPUT
|
|
52
|
+
|
|
53
|
+
- name: Publish to npm
|
|
54
|
+
run: npm publish --access public
|
|
55
|
+
|
|
56
|
+
- name: Create git tag
|
|
57
|
+
run: |
|
|
58
|
+
git tag "v${{ steps.pkg.outputs.version }}"
|
|
59
|
+
git push origin "v${{ steps.pkg.outputs.version }}"
|
|
60
|
+
|
|
61
|
+
- name: Create GitHub Release
|
|
62
|
+
uses: softprops/action-gh-release@v2
|
|
63
|
+
with:
|
|
64
|
+
tag_name: v${{ steps.pkg.outputs.version }}
|
|
65
|
+
name: v${{ steps.pkg.outputs.version }}
|
|
66
|
+
files: ${{ steps.pack.outputs.tarball }}
|
package/README.md
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Sets up the npm-trusts-github skill
|
|
2
|
+
|
|
3
|
+
> ⚠️ **ALPHA SOFTWARE** — This package is under active development.
|
|
4
|
+
> APIs, skill structure, and behavior may change without notice.
|
|
2
5
|
|
|
3
6
|
A skill that teaches an LLM how to set up npm trusted publishing (OIDC) with GitHub Actions.
|
|
4
7
|
|
|
8
|
+
Provide knowledge to the llm to setup npm, github and auth so a new version triggers publication on npm.
|
|
9
|
+
|
|
10
|
+
I myself for now prefer github private, and the npm instance is the public one.
|
|
11
|
+
|
|
12
|
+
At the moment in alpha, it's more about setting up from fresh, first time use focused.
|
|
13
|
+
|
|
14
|
+
Not yet atm : LLM should create a "publish to npm"-guideline folder or doc per project, with in it project specifics, then reference the guideline per project.
|
|
15
|
+
|
|
5
16
|
## Install on Pi
|
|
6
17
|
|
|
7
18
|
```bash
|
package/package.json
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gerdloos/npm-trusts-github-skill",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A skill that teaches an LLM how to set up npm trusted publishing with GitHub Actions",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi-package",
|
|
7
|
+
"npm",
|
|
8
|
+
"publish",
|
|
9
|
+
"workflow"
|
|
10
|
+
],
|
|
6
11
|
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/get-loose/npm-trusts-github-skill.git"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/get-loose/npm-trusts-github-skill#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/get-loose/npm-trusts-github-skill/issues"
|
|
19
|
+
},
|
|
7
20
|
"pi": {
|
|
8
|
-
"skills": [
|
|
21
|
+
"skills": [
|
|
22
|
+
"./skills"
|
|
23
|
+
]
|
|
9
24
|
}
|
|
10
25
|
}
|