@peterseibel/hug 0.1.7 → 0.1.8
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 +21 -0
- package/DEVELOPMENT.md +15 -17
- package/bin/hug +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v5
|
|
16
|
+
- uses: actions/setup-node@v5
|
|
17
|
+
with:
|
|
18
|
+
node-version: 24
|
|
19
|
+
registry-url: https://registry.npmjs.org
|
|
20
|
+
- run: npm install -g npm@latest
|
|
21
|
+
- run: npm publish --provenance --access public
|
package/DEVELOPMENT.md
CHANGED
|
@@ -47,29 +47,27 @@ Scoped packages are private by default. To publish as public:
|
|
|
47
47
|
npm publish --access public
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
###
|
|
50
|
+
### Automated publishing via GitHub Actions
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
Pushing a version tag triggers a GitHub Actions workflow that publishes to npm
|
|
53
|
+
automatically using [Trusted Publishing](https://docs.npmjs.com/trusted-publishers/)
|
|
54
|
+
(OIDC — no npm token needed).
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
npm version patch # 0.1.0 -> 0.1.1
|
|
56
|
-
npm version minor # 0.1.1 -> 0.2.0
|
|
57
|
-
npm version major # 0.2.0 -> 1.0.0
|
|
58
|
-
```
|
|
56
|
+
**One-time setup:**
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
1. On npmjs.com, go to the package settings for `@peterseibel/hug`.
|
|
59
|
+
2. Add a trusted publisher: your GitHub user/repo and workflow filename
|
|
60
|
+
(`publish.yml`).
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
**To release:**
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
3. Push the version commit and tag:
|
|
64
|
+
```bash
|
|
65
|
+
npm version patch # or minor / major
|
|
66
|
+
git push --follow-tags
|
|
67
|
+
```
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```
|
|
69
|
+
`npm version` bumps `package.json`, commits, and creates a `v*` tag. Pushing
|
|
70
|
+
the tag triggers the workflow in `.github/workflows/publish.yml`.
|
|
73
71
|
|
|
74
72
|
## Dependencies
|
|
75
73
|
|
package/bin/hug
CHANGED
|
@@ -11,7 +11,7 @@ done
|
|
|
11
11
|
HUG_ROOT="$(cd "$(dirname "$SOURCE")/.." && pwd)"
|
|
12
12
|
source "$HUG_ROOT/lib/common.sh"
|
|
13
13
|
|
|
14
|
-
VERSION
|
|
14
|
+
VERSION=$(grep '"version"' "$HUG_ROOT/package.json" | sed 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/')
|
|
15
15
|
|
|
16
16
|
usage() {
|
|
17
17
|
cat <<EOF
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peterseibel/hug",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "A lightweight wrapper around clasp for managing Google Apps Script projects",
|
|
5
5
|
"bin": {
|
|
6
6
|
"hug": "bin/hug"
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"google-apps-script",
|
|
10
10
|
"clasp"
|
|
11
11
|
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/gigamonkey/hug"
|
|
15
|
+
},
|
|
12
16
|
"license": "ISC",
|
|
13
17
|
"dependencies": {
|
|
14
18
|
"@google/clasp": "^3.2.0"
|