@gerdloos/npm-trusts-github-skill 1.0.2 → 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.
@@ -1,22 +1,66 @@
1
- name: Publish to npm
1
+ name: Publish to npm and create release
2
2
 
3
3
  on:
4
- push:
5
- tags:
6
- - 'v*'
4
+ workflow_dispatch:
7
5
 
8
6
  permissions:
9
7
  id-token: write
10
- contents: read
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
- - run: npm publish --access public --tag alpha
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gerdloos/npm-trusts-github-skill",
3
- "version": "1.0.2",
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
5
  "keywords": [
6
6
  "pi-package",
@@ -9,6 +9,14 @@
9
9
  "workflow"
10
10
  ],
11
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
+ },
12
20
  "pi": {
13
21
  "skills": [
14
22
  "./skills"