@@ -47,6 +47,16 @@ public String createGithubReleaseNotes(
4747 final String repo ,
4848 final String branchTag ,
4949 final String refType
50+ ) {
51+ return createGithubReleaseNotes (repo , branchTag , refType , false , null );
52+ }
53+
54+ public String createGithubReleaseNotes (
55+ final String repo ,
56+ final String branchTag ,
57+ final String refType ,
58+ final boolean hasCommands ,
59+ final String version
5060 ) {
5161 final String releasesPrefix = "/releases/download/" ;
5262 final File releaseFilesDir = getGithubReleaseFilesDir ();
@@ -114,19 +124,61 @@ public String createGithubReleaseNotes(
114124 .append ("<!-- id:" ).append (BUNDLE_LINUX_ARM64 ).append ("-link -->" )
115125 .append ("\n " ));
116126
117- if ("branch" .equals (refType )) {
118- notes .append ("\n Or launch app installer via command-line on Linux, Mac, or Windows:\n \n " );
119- notes .append ("```bash\n " );
120- notes .append ("/bin/bash -c \" $(curl -fsSL " ).append (JDEPLOY_WEBSITE_URL ).append ("gh/" )
121- .append (repo ).append ("/" ).append (branchTag ).append ("/install.sh)\" \n " );
122- notes .append ("```\n " );
123- notes .append ("\n See [download page](" ).append (JDEPLOY_WEBSITE_URL ).append ("gh/" ).append (repo ).append ("/" ).append (branchTag ).append (") for more download options.\n \n " );
124- } else {
125- notes .append ("\n Or launch app installer via command-line on Linux, Mac, or Windows:\n \n " );
126- notes .append ("```bash\n " );
127- notes .append ("/bin/bash -c \" $(curl -fsSL " ).append (JDEPLOY_WEBSITE_URL ).append ("gh/" ).append (repo ).append ("/install.sh)\" \n " );
128- notes .append ("```\n " );
129- notes .append ("\n See [download page](" ).append (JDEPLOY_WEBSITE_URL ).append ("gh/" ).append (repo ).append (") for more download options.\n \n " );
127+ // Only show CLI installation section if the app has commands defined
128+ if (hasCommands ) {
129+ notes .append ("\n ## CLI Installation\n \n " );
130+
131+ if ("branch" .equals (refType )) {
132+ // Branch release - include branch in URL
133+ String baseUrl = JDEPLOY_WEBSITE_URL + "gh/" + repo + "/" + branchTag ;
134+
135+ notes .append ("### Interactive\n " );
136+ notes .append ("```bash\n " );
137+ notes .append ("/bin/bash -c \" $(curl -fsSL '" ).append (baseUrl ).append ("/install.sh')\" \n " );
138+ notes .append ("```\n " );
139+ notes .append ("Launches graphical installer\n \n " );
140+
141+ notes .append ("### Headless\n " );
142+ notes .append ("```bash\n " );
143+ notes .append ("/bin/bash -c \" $(curl -fsSL '" ).append (baseUrl ).append ("/install.sh?headless=true')\" \n " );
144+ notes .append ("```\n " );
145+ notes .append ("For CI/CD and automated deployments\n \n " );
146+
147+ if (version != null && !version .isEmpty ()) {
148+ notes .append ("### Version-Pinned Headless\n " );
149+ notes .append ("```bash\n " );
150+ notes .append ("/bin/bash -c \" $(curl -fsSL '" ).append (baseUrl ).append ("/" ).append (version ).append ("/install.sh?headless=true')\" \n " );
151+ notes .append ("```\n " );
152+ notes .append ("Install specific version " ).append (version ).append ("\n \n " );
153+ }
154+
155+ notes .append ("See [download page](" ).append (baseUrl ).append (") for more download options.\n \n " );
156+ } else {
157+ // Tag release - no branch in URL
158+ String baseUrl = JDEPLOY_WEBSITE_URL + "gh/" + repo ;
159+
160+ notes .append ("### Interactive\n " );
161+ notes .append ("```bash\n " );
162+ notes .append ("/bin/bash -c \" $(curl -fsSL '" ).append (baseUrl ).append ("/install.sh')\" \n " );
163+ notes .append ("```\n " );
164+ notes .append ("Launches graphical installer\n \n " );
165+
166+ notes .append ("### Headless\n " );
167+ notes .append ("```bash\n " );
168+ notes .append ("/bin/bash -c \" $(curl -fsSL '" ).append (baseUrl ).append ("/install.sh?headless=true')\" \n " );
169+ notes .append ("```\n " );
170+ notes .append ("For CI/CD and automated deployments\n \n " );
171+
172+ if (version != null && !version .isEmpty ()) {
173+ notes .append ("### Version-Pinned Headless\n " );
174+ notes .append ("```bash\n " );
175+ notes .append ("/bin/bash -c \" $(curl -fsSL '" ).append (baseUrl ).append ("/" ).append (version ).append ("/install.sh?headless=true')\" \n " );
176+ notes .append ("```\n " );
177+ notes .append ("Install specific version " ).append (version ).append ("\n \n " );
178+ }
179+
180+ notes .append ("See [download page](" ).append (baseUrl ).append (") for more download options.\n \n " );
181+ }
130182 }
131183
132184 return notes .toString ();
0 commit comments