@onlooker-community/ecosystem 0.3.2 → 0.3.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.
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
name: Publish npm Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
7
|
+
# Manual trigger for emergency releases.
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
inputs:
|
|
10
|
+
version:
|
|
11
|
+
description: 'Version to publish (without v prefix)'
|
|
12
|
+
required: true
|
|
13
|
+
type: string
|
|
14
|
+
tag:
|
|
15
|
+
description: 'npm dist-tag (latest, beta, next)'
|
|
16
|
+
required: true
|
|
17
|
+
default: 'latest'
|
|
18
|
+
type: choice
|
|
19
|
+
options:
|
|
20
|
+
- latest
|
|
21
|
+
- beta
|
|
22
|
+
- next
|
|
23
|
+
|
|
24
|
+
permissions:
|
|
25
|
+
contents: read
|
|
26
|
+
id-token: write # for npm provenance
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
validate:
|
|
30
|
+
name: Validate
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
outputs:
|
|
33
|
+
version: ${{ steps.version.outputs.value }}
|
|
34
|
+
npm_tag: ${{ steps.tag.outputs.value }}
|
|
35
|
+
is_prerelease: ${{ steps.prerelease.outputs.value }}
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@v4
|
|
38
|
+
|
|
39
|
+
- name: Resolve version
|
|
40
|
+
id: version
|
|
41
|
+
run: |
|
|
42
|
+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
43
|
+
echo "value=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
|
|
44
|
+
else
|
|
45
|
+
echo "value=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
- name: Resolve npm tag
|
|
49
|
+
id: tag
|
|
50
|
+
run: |
|
|
51
|
+
VERSION=${{ steps.version.outputs.value }}
|
|
52
|
+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
53
|
+
echo "value=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
|
|
54
|
+
elif [[ "$VERSION" == *"-beta"* ]]; then
|
|
55
|
+
echo "value=beta" >> "$GITHUB_OUTPUT"
|
|
56
|
+
elif [[ "$VERSION" == *"-rc"* ]]; then
|
|
57
|
+
echo "value=next" >> "$GITHUB_OUTPUT"
|
|
58
|
+
else
|
|
59
|
+
echo "value=latest" >> "$GITHUB_OUTPUT"
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
- name: Check if prerelease
|
|
63
|
+
id: prerelease
|
|
64
|
+
run: |
|
|
65
|
+
VERSION=${{ steps.version.outputs.value }}
|
|
66
|
+
if [[ "$VERSION" == *"-"* ]]; then
|
|
67
|
+
echo "value=true" >> "$GITHUB_OUTPUT"
|
|
68
|
+
else
|
|
69
|
+
echo "value=false" >> "$GITHUB_OUTPUT"
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
- name: Verify package.json version matches
|
|
73
|
+
run: |
|
|
74
|
+
PKG_VERSION=$(node -p "require('./package.json').version")
|
|
75
|
+
TAG_VERSION=${{ steps.version.outputs.value }}
|
|
76
|
+
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
|
|
77
|
+
echo "ERROR: package.json version ($PKG_VERSION) does not match tag ($TAG_VERSION)"
|
|
78
|
+
exit 1
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
test:
|
|
82
|
+
name: Test
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
strategy:
|
|
85
|
+
matrix:
|
|
86
|
+
node: ['20', '22']
|
|
87
|
+
steps:
|
|
88
|
+
- uses: actions/checkout@v4
|
|
89
|
+
|
|
90
|
+
- uses: actions/setup-node@v4
|
|
91
|
+
with:
|
|
92
|
+
node-version: ${{ matrix.node }}
|
|
93
|
+
cache: npm
|
|
94
|
+
|
|
95
|
+
- run: npm ci
|
|
96
|
+
- run: npm run build
|
|
97
|
+
- run: npm test
|
|
98
|
+
- run: npm run typecheck
|
|
99
|
+
|
|
100
|
+
publish:
|
|
101
|
+
name: Publish to npm
|
|
102
|
+
runs-on: ubuntu-latest
|
|
103
|
+
needs: [validate, test]
|
|
104
|
+
environment: npm-publish
|
|
105
|
+
steps:
|
|
106
|
+
- uses: actions/checkout@v4
|
|
107
|
+
|
|
108
|
+
- uses: actions/setup-node@v4
|
|
109
|
+
with:
|
|
110
|
+
node-version: '22'
|
|
111
|
+
registry-url: 'https://registry.npmjs.org'
|
|
112
|
+
cache: npm
|
|
113
|
+
|
|
114
|
+
- run: npm ci
|
|
115
|
+
- run: npm run build
|
|
116
|
+
|
|
117
|
+
- name: Publish
|
|
118
|
+
run: |
|
|
119
|
+
npm publish \
|
|
120
|
+
--tag ${{ needs.validate.outputs.npm_tag }} \
|
|
121
|
+
--access public \
|
|
122
|
+
--provenance
|
|
123
|
+
env:
|
|
124
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
125
|
+
|
|
126
|
+
release:
|
|
127
|
+
name: Create GitHub Release
|
|
128
|
+
runs-on: ubuntu-latest
|
|
129
|
+
needs: [validate, publish]
|
|
130
|
+
permissions:
|
|
131
|
+
contents: write
|
|
132
|
+
steps:
|
|
133
|
+
- uses: actions/checkout@v4
|
|
134
|
+
|
|
135
|
+
- name: Extract changelog entry
|
|
136
|
+
id: changelog
|
|
137
|
+
run: |
|
|
138
|
+
VERSION=${{ needs.validate.outputs.version }}
|
|
139
|
+
NOTES=$(awk "/^## \[?${VERSION}\]?/{found=1; next} found && /^## /{exit} found{print}" CHANGELOG.md)
|
|
140
|
+
if [ -z "$NOTES" ]; then
|
|
141
|
+
NOTES="See CHANGELOG.md for details."
|
|
142
|
+
fi
|
|
143
|
+
echo "notes<<EOF" >> "$GITHUB_OUTPUT"
|
|
144
|
+
echo "$NOTES" >> "$GITHUB_OUTPUT"
|
|
145
|
+
echo "EOF" >> "$GITHUB_OUTPUT"
|
|
146
|
+
|
|
147
|
+
- name: Create GitHub release
|
|
148
|
+
uses: softprops/action-gh-release@v2
|
|
149
|
+
with:
|
|
150
|
+
name: v${{ needs.validate.outputs.version }}
|
|
151
|
+
body: ${{ steps.changelog.outputs.notes }}
|
|
152
|
+
prerelease: ${{ needs.validate.outputs.is_prerelease == 'true' }}
|
|
153
|
+
draft: false
|
|
@@ -11,45 +11,19 @@ on:
|
|
|
11
11
|
permissions:
|
|
12
12
|
contents: write
|
|
13
13
|
pull-requests: write
|
|
14
|
-
issues: write
|
|
15
|
-
id-token: write
|
|
16
14
|
|
|
17
15
|
jobs:
|
|
18
16
|
release-please:
|
|
19
17
|
name: Release Please
|
|
20
18
|
runs-on: ubuntu-latest
|
|
21
19
|
steps:
|
|
22
|
-
-
|
|
23
|
-
id: release
|
|
24
|
-
uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
|
|
20
|
+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
|
|
25
21
|
with:
|
|
22
|
+
release-type: node
|
|
26
23
|
# Use a PAT instead of GITHUB_TOKEN so the release PR triggers
|
|
27
24
|
# downstream workflows (CI, etc.). Events caused by GITHUB_TOKEN
|
|
28
25
|
# deliberately do not fan out to other workflows; that policy
|
|
29
26
|
# leaves release PRs unchecked. Set RELEASE_PLEASE_PAT to a
|
|
30
27
|
# fine-grained token with Contents:write + Pull requests:write
|
|
31
28
|
# scoped to this repo.
|
|
32
|
-
token: ${{ secrets.RELEASE_PLEASE_PAT }}
|
|
33
|
-
|
|
34
|
-
# release-please-action does not check out the repo; npm publish needs the
|
|
35
|
-
# tagged release tree (package.json, install.sh, hooks, etc.).
|
|
36
|
-
- name: Checkout release tag
|
|
37
|
-
if: ${{ steps.release.outputs.releases_created == 'true' }}
|
|
38
|
-
uses: actions/checkout@v4
|
|
39
|
-
with:
|
|
40
|
-
ref: ${{ steps.release.outputs.tag_name }}
|
|
41
|
-
|
|
42
|
-
- name: Setup Node
|
|
43
|
-
if: ${{ steps.release.outputs.releases_created == 'true' }}
|
|
44
|
-
uses: actions/setup-node@v6
|
|
45
|
-
with:
|
|
46
|
-
node-version: '22'
|
|
47
|
-
registry-url: 'https://registry.npmjs.org'
|
|
48
|
-
|
|
49
|
-
- name: Publish to npm
|
|
50
|
-
if: ${{ steps.release.outputs.releases_created == 'true' }}
|
|
51
|
-
env:
|
|
52
|
-
NPM_CONFIG_PROVENANCE: true
|
|
53
|
-
run: |
|
|
54
|
-
npm ci
|
|
55
|
-
npm publish --access=public
|
|
29
|
+
token: ${{ secrets.RELEASE_PLEASE_PAT }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.3](https://github.com/onlooker-community/ecosystem/compare/v0.3.2...v0.3.3) (2026-05-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Chores
|
|
7
|
+
|
|
8
|
+
* enhance release workflow with conditional publishing ([d14a868](https://github.com/onlooker-community/ecosystem/commit/d14a86858dcdeb3ed87aa00985c2c79f9ca8a4d3))
|
|
9
|
+
|
|
3
10
|
## [0.3.2](https://github.com/onlooker-community/ecosystem/compare/v0.3.1...v0.3.2) (2026-05-22)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED