Skip to content

Commit 77a8610

Browse files
authored
Merge branch 'main' into version-bump-fix-subscription-i18n
2 parents dfc130a + ba355b5 commit 77a8610

39 files changed

+799
-64
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Post Release Summary Comment
2+
description: Post or update a PR comment summarizing release links with diff, derived versions, and optional extras.
3+
author: ComfyUI Frontend Team
4+
5+
inputs:
6+
issue-number:
7+
description: Optional PR number override (defaults to the current pull request)
8+
default: ''
9+
version_file:
10+
description: Path to the JSON file containing the current version (relative to repo root)
11+
required: true
12+
13+
outputs:
14+
prev_version:
15+
description: Previous version derived from the parent commit
16+
value: ${{ steps.build.outputs.prev_version }}
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Build comment body
22+
id: build
23+
shell: bash
24+
run: |
25+
set -euo pipefail
26+
27+
VERSION_FILE="${{ inputs.version_file }}"
28+
REPO="${{ github.repository }}"
29+
30+
if [[ -z "$VERSION_FILE" ]]; then
31+
echo '::error::version_file input is required' >&2
32+
exit 1
33+
fi
34+
35+
PREV_JSON=$(git show HEAD^1:"$VERSION_FILE" 2>/dev/null || true)
36+
if [[ -z "$PREV_JSON" ]]; then
37+
echo "::error::Unable to read $VERSION_FILE from parent commit" >&2
38+
exit 1
39+
fi
40+
PREV_VERSION=$(printf '%s' "$PREV_JSON" | node -pe "const data = JSON.parse(require('fs').readFileSync(0, 'utf8')); if (!data.version) { process.exit(1); } data.version")
41+
if [[ -z "$PREV_VERSION" ]]; then
42+
echo "::error::Unable to determine previous version from $VERSION_FILE" >&2
43+
exit 1
44+
fi
45+
46+
NEW_VERSION=$(node -pe "const fs=require('fs');const data=JSON.parse(fs.readFileSync(process.argv[1],'utf8'));if(!data.version){process.exit(1);}data.version" "$VERSION_FILE")
47+
if [[ -z "$NEW_VERSION" ]]; then
48+
echo "::error::Unable to determine current version from $VERSION_FILE" >&2
49+
exit 1
50+
fi
51+
52+
MARKER='release-summary'
53+
MESSAGE='Publish jobs finished successfully:'
54+
LINKS_VALUE=''
55+
56+
case "$VERSION_FILE" in
57+
package.json)
58+
LINKS_VALUE=$'PyPI|https://pypi.org/project/comfyui-frontend-package/{{version}}/\n''npm types|https://npm.im/@comfyorg/comfyui-frontend-types@{{version}}'
59+
;;
60+
apps/desktop-ui/package.json)
61+
MARKER='desktop-release-summary'
62+
LINKS_VALUE='npm desktop UI|https://npm.im/@comfyorg/desktop-ui@{{version}}'
63+
;;
64+
esac
65+
66+
DIFF_PREFIX='v'
67+
DIFF_LABEL='Diff'
68+
DIFF_URL="https://github.com/${REPO}/compare/${DIFF_PREFIX}${PREV_VERSION}...${DIFF_PREFIX}${NEW_VERSION}"
69+
COMMENT_FILE=$(mktemp)
70+
71+
{
72+
printf '<!--%s:%s%s-->\n' "$MARKER" "$DIFF_PREFIX" "$NEW_VERSION"
73+
printf '%s\n\n' "$MESSAGE"
74+
printf -- '- %s: [%s%s...%s%s](%s)\n' "$DIFF_LABEL" "$DIFF_PREFIX" "$PREV_VERSION" "$DIFF_PREFIX" "$NEW_VERSION" "$DIFF_URL"
75+
76+
while IFS= read -r RAW_LINE; do
77+
LINE=$(printf '%s' "$RAW_LINE" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
78+
[[ -z "$LINE" ]] && continue
79+
if [[ "$LINE" != *"|"* ]]; then
80+
echo "::warning::Skipping malformed link entry: $LINE" >&2
81+
continue
82+
fi
83+
LABEL=${LINE%%|*}
84+
URL_TEMPLATE=${LINE#*|}
85+
URL=${URL_TEMPLATE//\{\{version\}\}/$NEW_VERSION}
86+
URL=${URL//\{\{prev_version\}\}/$PREV_VERSION}
87+
printf -- '- %s: %s\n' "$LABEL" "$URL"
88+
done <<< "$LINKS_VALUE"
89+
90+
printf '\n'
91+
} > "$COMMENT_FILE"
92+
93+
{
94+
echo "body<<'EOF'"
95+
cat "$COMMENT_FILE"
96+
echo 'EOF'
97+
} >> "$GITHUB_OUTPUT"
98+
echo "prev_version=$PREV_VERSION" >> "$GITHUB_OUTPUT"
99+
echo "marker_search=<!--$MARKER:" >> "$GITHUB_OUTPUT"
100+
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
101+
102+
- name: Find existing comment
103+
id: find
104+
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad
105+
with:
106+
issue-number: ${{ inputs.issue-number || github.event.pull_request.number }}
107+
comment-author: github-actions[bot]
108+
body-includes: ${{ steps.build.outputs.marker_search }}
109+
110+
- name: Post or update comment
111+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
112+
with:
113+
issue-number: ${{ inputs.issue-number || github.event.pull_request.number }}
114+
comment-id: ${{ steps.find.outputs.comment-id }}
115+
body: ${{ steps.build.outputs.body }}
116+
edit-mode: replace

.github/workflows/publish-desktop-ui-on-merge.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
---
12
name: Publish Desktop UI on PR Merge
23

34
on:
45
pull_request:
5-
types: [ closed ]
6-
branches: [ main, core/* ]
6+
types: ['closed']
7+
branches: [main, core/*]
78
paths:
89
- 'apps/desktop-ui/package.json'
910

@@ -57,3 +58,26 @@ jobs:
5758
secrets:
5859
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5960

61+
comment_desktop_publish:
62+
name: Comment Desktop Publish Summary
63+
needs:
64+
- resolve
65+
- publish
66+
if: success()
67+
runs-on: ubuntu-latest
68+
permissions:
69+
contents: read
70+
issues: write
71+
pull-requests: write
72+
steps:
73+
- name: Checkout merge commit
74+
uses: actions/checkout@v5
75+
with:
76+
ref: ${{ github.event.pull_request.merge_commit_sha }}
77+
fetch-depth: 2
78+
79+
- name: Post desktop release summary comment
80+
uses: ./.github/actions/comment-release-links
81+
with:
82+
issue-number: ${{ github.event.pull_request.number }}
83+
version_file: apps/desktop-ui/package.json

.github/workflows/release-draft-create.yaml

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
---
12
name: Release Draft Create
23

34
on:
45
pull_request:
5-
types: [ closed ]
6-
branches: [ main, core/* ]
6+
types: ['closed']
7+
branches: [main, core/*]
78
paths:
89
- 'package.json'
910

@@ -30,7 +31,9 @@ jobs:
3031

3132
- name: Get current version
3233
id: current_version
33-
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
34+
run: |
35+
VERSION=$(node -p "require('./package.json').version")
36+
echo "version=$VERSION" >> $GITHUB_OUTPUT
3437
- name: Check if prerelease
3538
id: check_prerelease
3639
run: |
@@ -71,17 +74,23 @@ jobs:
7174
name: dist-files
7275
- name: Create release
7376
id: create_release
74-
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631
77+
uses: >-
78+
softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631
7579
env:
7680
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7781
with:
7882
files: |
7983
dist.zip
8084
tag_name: v${{ needs.build.outputs.version }}
8185
target_commitish: ${{ github.event.pull_request.base.ref }}
82-
make_latest: ${{ github.event.pull_request.base.ref == 'main' && needs.build.outputs.is_prerelease == 'false' }}
83-
draft: ${{ github.event.pull_request.base.ref != 'main' || needs.build.outputs.is_prerelease == 'true' }}
84-
prerelease: ${{ needs.build.outputs.is_prerelease == 'true' }}
86+
make_latest: >-
87+
${{ github.event.pull_request.base.ref == 'main' &&
88+
needs.build.outputs.is_prerelease == 'false' }}
89+
draft: >-
90+
${{ github.event.pull_request.base.ref != 'main' ||
91+
needs.build.outputs.is_prerelease == 'true' }}
92+
prerelease: >-
93+
${{ needs.build.outputs.is_prerelease == 'true' }}
8594
generate_release_notes: true
8695

8796
publish_pypi:
@@ -110,7 +119,8 @@ jobs:
110119
env:
111120
COMFYUI_FRONTEND_VERSION: ${{ needs.build.outputs.version }}
112121
- name: Publish pypi package
113-
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
122+
uses: >-
123+
pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
114124
with:
115125
password: ${{ secrets.PYPI_TOKEN }}
116126
packages-dir: comfyui_frontend_package/dist
@@ -122,3 +132,28 @@ jobs:
122132
version: ${{ needs.build.outputs.version }}
123133
ref: ${{ github.event.pull_request.merge_commit_sha }}
124134
secrets: inherit
135+
136+
comment_release_summary:
137+
name: Comment Release Summary
138+
needs:
139+
- draft_release
140+
- publish_pypi
141+
- publish_types
142+
if: success()
143+
runs-on: ubuntu-latest
144+
permissions:
145+
contents: read
146+
issues: write
147+
pull-requests: write
148+
steps:
149+
- name: Checkout merge commit
150+
uses: actions/checkout@v5
151+
with:
152+
ref: ${{ github.event.pull_request.merge_commit_sha }}
153+
fetch-depth: 2
154+
155+
- name: Post release summary comment
156+
uses: ./.github/actions/comment-release-links
157+
with:
158+
issue-number: ${{ github.event.pull_request.number }}
159+
version_file: package.json

.storybook/main.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,15 @@ const config: StorybookConfig = {
7474
'@': process.cwd() + '/src'
7575
}
7676
},
77+
esbuild: {
78+
// Prevent minification of identifiers to preserve _sfc_main
79+
minifyIdentifiers: false,
80+
keepNames: true
81+
},
7782
build: {
7883
rollupOptions: {
84+
// Disable tree-shaking for Storybook to prevent Vue SFC exports from being removed
85+
treeshake: false,
7986
onwarn: (warning, warn) => {
8087
// Suppress specific warnings
8188
if (

apps/desktop-ui/.storybook/main.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,15 @@ const config: StorybookConfig = {
7575
'@frontend-locales': process.cwd() + '/../../src/locales'
7676
}
7777
},
78+
esbuild: {
79+
// Prevent minification of identifiers to preserve _sfc_main
80+
minifyIdentifiers: false,
81+
keepNames: true
82+
},
7883
build: {
7984
rollupOptions: {
85+
// Disable tree-shaking for Storybook to prevent Vue SFC exports from being removed
86+
treeshake: false,
8087
onwarn: (warning, warn) => {
8188
// Suppress specific warnings
8289
if (

0 commit comments

Comments
 (0)