Skip to content

Commit f330343

Browse files
Merge remote-tracking branch 'upstream/main' into feat/action-bar
2 parents 7becad5 + 6a44d71 commit f330343

File tree

84 files changed

+2054
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2054
-295
lines changed

.github/workflows/autofix.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ jobs:
2626

2727
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
2828
name: 🟧 Install pnpm
29-
with:
30-
cache: true
3129

3230
- name: 📦 Install dependencies
3331
run: pnpm install

.github/workflows/chromatic.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ jobs:
3232

3333
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
3434
name: 🟧 Install pnpm
35-
with:
36-
cache: true
3735

3836
- name: 📦 Install dependencies
3937
run: pnpm install

.github/workflows/ci.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
branches:
66
- main
7+
- release
78
push:
89
branches:
910
- main
@@ -33,8 +34,6 @@ jobs:
3334

3435
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
3536
name: 🟧 Install pnpm
36-
with:
37-
cache: true
3837

3938
- name: 📦 Install dependencies (root only, no scripts)
4039
run: pnpm install --filter . --ignore-scripts
@@ -55,8 +54,6 @@ jobs:
5554

5655
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
5756
name: 🟧 Install pnpm
58-
with:
59-
cache: true
6057

6158
- name: 📦 Install dependencies
6259
run: pnpm install
@@ -77,8 +74,6 @@ jobs:
7774

7875
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
7976
name: 🟧 Install pnpm
80-
with:
81-
cache: true
8277

8378
- name: 📦 Install dependencies
8479
run: pnpm install
@@ -105,8 +100,6 @@ jobs:
105100

106101
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
107102
name: 🟧 Install pnpm
108-
with:
109-
cache: true
110103

111104
- name: 📦 Install dependencies
112105
run: pnpm install
@@ -144,8 +137,6 @@ jobs:
144137

145138
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
146139
name: 🟧 Install pnpm
147-
with:
148-
cache: true
149140

150141
- name: 📦 Install dependencies
151142
run: pnpm install
@@ -174,8 +165,6 @@ jobs:
174165

175166
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
176167
name: 🟧 Install pnpm
177-
with:
178-
cache: true
179168

180169
- name: 📦 Install dependencies
181170
run: pnpm install
@@ -202,8 +191,6 @@ jobs:
202191

203192
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
204193
name: 🟧 Install pnpm
205-
with:
206-
cache: true
207194

208195
- name: 📦 Install dependencies
209196
run: pnpm install
@@ -227,8 +214,6 @@ jobs:
227214

228215
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
229216
name: 🟧 Install pnpm
230-
with:
231-
cache: true
232217

233218
- name: 📦 Install dependencies (root only, no scripts)
234219
run: pnpm install --filter . --ignore-scripts

.github/workflows/lunaria.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ jobs:
3434

3535
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
3636
name: 🟧 Install pnpm
37-
with:
38-
cache: true
3937

4038
- name: 📦 Install dependencies
4139
run: pnpm install

.github/workflows/release-pr.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: release-pr
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
release-pr:
14+
name: 🚀 Create or update release PR
15+
runs-on: ubuntu-slim
16+
if: github.repository == 'npmx-dev/npmx.dev'
17+
18+
steps:
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
24+
with:
25+
node-version: lts/*
26+
27+
- name: 🔍 Check for unreleased commits
28+
id: check
29+
run: |
30+
git fetch origin release
31+
COMMITS=$(git log origin/release..origin/main --oneline)
32+
if [ -z "$COMMITS" ]; then
33+
echo "skip=true" >> "$GITHUB_OUTPUT"
34+
echo "No new commits to release"
35+
else
36+
echo "skip=false" >> "$GITHUB_OUTPUT"
37+
echo "Found unreleased commits:"
38+
echo "$COMMITS"
39+
fi
40+
41+
- name: 🔢 Determine next version
42+
if: steps.check.outputs.skip == 'false'
43+
id: version
44+
run: |
45+
VERSION_JSON=$(node scripts/next-version.ts)
46+
CURRENT_VERSION=$(echo "$VERSION_JSON" | jq -r .current)
47+
NEXT_VERSION=$(echo "$VERSION_JSON" | jq -r .next)
48+
FROM_REF=$(echo "$VERSION_JSON" | jq -r .from)
49+
echo "current=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
50+
echo "next=v${NEXT_VERSION}" >> "$GITHUB_OUTPUT"
51+
echo "from=$FROM_REF" >> "$GITHUB_OUTPUT"
52+
53+
- name: 📝 Generate changelog body
54+
if: steps.check.outputs.skip == 'false'
55+
id: changelog
56+
env:
57+
CURRENT_VERSION: ${{ steps.version.outputs.current }}
58+
NEXT_VERSION: ${{ steps.version.outputs.next }}
59+
FROM_REF: ${{ steps.version.outputs.from }}
60+
run: |
61+
# Categorize commits
62+
FEATURES=""
63+
FIXES=""
64+
CHORES=""
65+
OTHER=""
66+
67+
while IFS= read -r line; do
68+
[ -z "$line" ] && continue
69+
SHA=$(echo "$line" | cut -d' ' -f1)
70+
MSG=$(echo "$line" | cut -d' ' -f2-)
71+
ENTRY="- $MSG (\`$SHA\`)"
72+
73+
if echo "$MSG" | grep -qE '^feat(\(|:)'; then
74+
FEATURES="${FEATURES}${ENTRY}\n"
75+
elif echo "$MSG" | grep -qE '^fix(\(|:)'; then
76+
FIXES="${FIXES}${ENTRY}\n"
77+
elif echo "$MSG" | grep -qE '^(chore|ci|build|perf|refactor|style|test|docs)(\(|:)'; then
78+
CHORES="${CHORES}${ENTRY}\n"
79+
else
80+
OTHER="${OTHER}${ENTRY}\n"
81+
fi
82+
done <<< "$(git log "$FROM_REF"..origin/main --oneline --no-merges)"
83+
84+
# Strip the leading 'v' for display
85+
DISPLAY_NEXT="${NEXT_VERSION#v}"
86+
87+
# Build the PR body
88+
BODY="This PR will deploy the following changes to production (\`npmx.dev\`).\n\n"
89+
BODY="${BODY}**Next version: \`${NEXT_VERSION}\`** (current: \`v${CURRENT_VERSION}\`)\n\n"
90+
91+
if [ -n "$FEATURES" ]; then
92+
BODY="${BODY}### Features\n\n${FEATURES}\n"
93+
fi
94+
if [ -n "$FIXES" ]; then
95+
BODY="${BODY}### Fixes\n\n${FIXES}\n"
96+
fi
97+
if [ -n "$CHORES" ]; then
98+
BODY="${BODY}### Other Changes\n\n${CHORES}\n"
99+
fi
100+
if [ -n "$OTHER" ]; then
101+
BODY="${BODY}### Uncategorized\n\n${OTHER}\n"
102+
fi
103+
104+
BODY="${BODY}---\n\n"
105+
BODY="${BODY}> Merging this PR will:\n"
106+
BODY="${BODY}> - Deploy to \`npmx.dev\` via Vercel\n"
107+
BODY="${BODY}> - Create a \`${NEXT_VERSION}\` tag and GitHub Release\n"
108+
BODY="${BODY}> - Publish \`npmx-connector@${DISPLAY_NEXT}\` to npm"
109+
110+
# Write body to file, truncating if needed (GitHub limits PR body to 65536 chars)
111+
echo -e "$BODY" > /tmp/pr-body.md
112+
if [ "$(wc -c < /tmp/pr-body.md)" -gt 60000 ]; then
113+
COMMIT_COUNT=$(git log "$FROM_REF"..origin/main --oneline --no-merges | wc -l)
114+
COMPARE_URL="https://github.com/npmx-dev/npmx.dev/compare/${FROM_REF}...main"
115+
TRUNCATED="This PR will deploy the following changes to production (\`npmx.dev\`).\n\n"
116+
TRUNCATED="${TRUNCATED}**Next version: \`${NEXT_VERSION}\`** (current: \`v${CURRENT_VERSION}\`)\n\n"
117+
TRUNCATED="${TRUNCATED}> **${COMMIT_COUNT} commits** are included in this release. The full changelog is too large to display here.\n>\n"
118+
TRUNCATED="${TRUNCATED}> [View full diff on GitHub](${COMPARE_URL})\n\n"
119+
TRUNCATED="${TRUNCATED}---\n\n"
120+
TRUNCATED="${TRUNCATED}> Merging this PR will:\n"
121+
TRUNCATED="${TRUNCATED}> - Deploy to \`npmx.dev\` via Vercel\n"
122+
TRUNCATED="${TRUNCATED}> - Create a \`${NEXT_VERSION}\` tag and GitHub Release\n"
123+
TRUNCATED="${TRUNCATED}> - Publish \`npmx-connector@${DISPLAY_NEXT}\` to npm"
124+
echo -e "$TRUNCATED" > /tmp/pr-body.md
125+
fi
126+
127+
- name: 🚀 Create or update release PR
128+
if: steps.check.outputs.skip == 'false'
129+
env:
130+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131+
NEXT_VERSION: ${{ steps.version.outputs.next }}
132+
run: |
133+
EXISTING_PR=$(gh pr list --base release --head main --state open --json number --jq '.[0].number')
134+
135+
if [ -n "$EXISTING_PR" ]; then
136+
gh pr edit "$EXISTING_PR" \
137+
--title "chore: release ${NEXT_VERSION}" \
138+
--body-file /tmp/pr-body.md
139+
echo "Updated existing PR #${EXISTING_PR}"
140+
else
141+
gh pr create \
142+
--base release \
143+
--head main \
144+
--title "chore: release ${NEXT_VERSION}" \
145+
--body-file /tmp/pr-body.md \
146+
--label "release"
147+
echo "Created new release PR"
148+
fi

.github/workflows/release-tag.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: release-tag
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
8+
permissions: {}
9+
10+
jobs:
11+
tag:
12+
name: 🏷️ Tag release and create GitHub Release
13+
runs-on: ubuntu-slim
14+
if: github.repository == 'npmx-dev/npmx.dev'
15+
permissions:
16+
contents: write
17+
outputs:
18+
version: ${{ steps.version.outputs.next }}
19+
skipped: ${{ steps.check.outputs.skip }}
20+
21+
steps:
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
27+
with:
28+
node-version: lts/*
29+
30+
- name: 🔢 Determine next version
31+
id: version
32+
run: |
33+
VERSION_JSON=$(node scripts/next-version.ts)
34+
echo "current=$(echo "$VERSION_JSON" | jq -r .current)" >> "$GITHUB_OUTPUT"
35+
echo "next=v$(echo "$VERSION_JSON" | jq -r .next)" >> "$GITHUB_OUTPUT"
36+
echo "from=$(echo "$VERSION_JSON" | jq -r .from)" >> "$GITHUB_OUTPUT"
37+
echo "Bumping from v$(echo "$VERSION_JSON" | jq -r .current) to v$(echo "$VERSION_JSON" | jq -r .next)"
38+
39+
- name: 🔍 Check if tag already exists
40+
id: check
41+
env:
42+
VERSION: ${{ steps.version.outputs.next }}
43+
run: |
44+
if git rev-parse "$VERSION" >/dev/null 2>&1; then
45+
echo "skip=true" >> "$GITHUB_OUTPUT"
46+
echo "Tag $VERSION already exists, skipping"
47+
else
48+
echo "skip=false" >> "$GITHUB_OUTPUT"
49+
fi
50+
51+
- name: 🏷️ Create and push tag
52+
if: steps.check.outputs.skip == 'false'
53+
env:
54+
VERSION: ${{ steps.version.outputs.next }}
55+
run: |
56+
git config user.name "github-actions[bot]"
57+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
58+
git tag -a "$VERSION" -m "Release $VERSION"
59+
git push origin "$VERSION"
60+
61+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
62+
if: steps.check.outputs.skip == 'false'
63+
name: 🟧 Install pnpm
64+
65+
- name: 📦 Install dependencies
66+
if: steps.check.outputs.skip == 'false'
67+
run: pnpm install --filter . --ignore-scripts
68+
69+
- name: 📝 Generate release notes
70+
if: steps.check.outputs.skip == 'false'
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
FROM_REF: ${{ steps.version.outputs.from }}
74+
run: node scripts/release-notes.ts "$FROM_REF" > /tmp/release-notes.md
75+
76+
- name: 🚀 Create GitHub Release
77+
if: steps.check.outputs.skip == 'false'
78+
env:
79+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
VERSION: ${{ steps.version.outputs.next }}
81+
run: |
82+
gh release create "$VERSION" \
83+
--notes-file /tmp/release-notes.md \
84+
--title "$VERSION"
85+
86+
publish-connector:
87+
name: 📦 Publish npmx-connector to npm
88+
runs-on: ubuntu-slim
89+
needs: tag
90+
if: needs.tag.outputs.skipped == 'false'
91+
permissions:
92+
contents: read
93+
id-token: write
94+
environment: npm-publish
95+
96+
steps:
97+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
98+
with:
99+
ref: release
100+
101+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
102+
with:
103+
node-version: lts/*
104+
registry-url: https://registry.npmjs.org
105+
106+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
107+
name: 🟧 Install pnpm
108+
with:
109+
cache: false
110+
111+
- name: 📦 Install dependencies
112+
run: pnpm install --filter npmx-connector...
113+
114+
- name: 🔢 Set connector version
115+
env:
116+
VERSION: ${{ needs.tag.outputs.version }}
117+
run: |
118+
# Strip the 'v' prefix for package.json
119+
PKG_VERSION="${VERSION#v}"
120+
cd cli
121+
npm version "$PKG_VERSION" --no-git-tag-version
122+
echo "Publishing npmx-connector@${PKG_VERSION}"
123+
124+
- name: 🏗️ Build connector
125+
run: pnpm --filter npmx-connector build
126+
127+
- name: 📤 Publish to npm with provenance
128+
# Uses OIDC trusted publishing — no NPM_TOKEN needed.
129+
# Configure on npmjs.com: repo npmx-dev/npmx.dev, workflow release-tag.yml, environment npm-publish
130+
run: npm publish --provenance --access public
131+
working-directory: cli

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ What npmx offers:
2727
## Shortcuts
2828

2929
- [chat.npmx.dev](https://chat.npmx.dev) - Discord Server
30+
- [build.npmx.dev](https://build.npmx.dev) - Builders Discord Server
3031
- [social.npmx.dev](https://social.npmx.dev) - Bluesky Profile
3132
- [repo.npmx.dev](https://repo.npmx.dev) - GitHub Repository
3233
- [issues.npmx.dev](https://issues.npmx.dev) - GitHub Issues

0 commit comments

Comments
 (0)