@@ -150,6 +150,89 @@ jobs:
150150
151151 echo "path=${asset}" >> "$GITHUB_OUTPUT"
152152
153+ - name : Package release assets
154+ if : steps.state.outputs.release_exists == 'false'
155+ id : package
156+ run : |
157+ set -euo pipefail
158+
159+ release_dir="release-assets"
160+ installer_name="install-github-report.sh"
161+ guide_name="INSTALL.txt"
162+ bundle_name="github-report-install-${{ steps.version.outputs.version }}.tar.gz"
163+ checksums_name="github-report-${{ steps.version.outputs.version }}-SHA256SUMS.txt"
164+
165+ rm -rf "${release_dir}"
166+ mkdir -p "${release_dir}/bundle"
167+
168+ cp "${{ steps.asset.outputs.path }}" "${release_dir}/"
169+ cp "${installer_name}" "${release_dir}/${installer_name}"
170+ chmod 0755 "${release_dir}/${installer_name}"
171+
172+ python - "${release_dir}/${guide_name}" "${bundle_name}" "${{ steps.version.outputs.tag }}" <<'PY'
173+ import os
174+ import sys
175+ from pathlib import Path
176+ from textwrap import dedent
177+
178+ guide_path, bundle_name, tag = sys.argv[1:4]
179+ repository = os.environ["GITHUB_REPOSITORY"]
180+
181+ content = dedent(
182+ f"""
183+ github-report install guide
184+ =========================
185+
186+ Recommended install path: use the bundled install archive from this release.
187+
188+ 1. Extract this archive.
189+ 2. Open a terminal in the extracted folder.
190+ 3. Run:
191+
192+ bash ./install-github-report.sh
193+
194+ What the installer does:
195+ - installs Python automatically when needed on macOS and Ubuntu/Debian-style Linux
196+ - installs the bundled github-report wheel
197+ - creates the github-report launcher in ~/.local/bin
198+ - verifies the installed version
199+ - explains how to create a GitHub account and token if you do not have one yet
200+
201+ If you want to install directly from the release page without extracting first:
202+
203+ curl -fsSLO https://github.com/{repository}/releases/download/{tag}/{bundle_name}
204+ tar -xzf {bundle_name}
205+ bash ./install-github-report.sh
206+ """
207+ ).lstrip()
208+
209+ Path(guide_path).write_text(content, encoding="utf-8")
210+ PY
211+
212+ cp "${release_dir}/${installer_name}" "${release_dir}/bundle/${installer_name}"
213+ cp "${release_dir}/${guide_name}" "${release_dir}/bundle/${guide_name}"
214+ cp "${{ steps.asset.outputs.path }}" "${release_dir}/bundle/"
215+
216+ tar -C "${release_dir}/bundle" -czf "${release_dir}/${bundle_name}" \
217+ "${installer_name}" \
218+ "${guide_name}" \
219+ "$(basename -- "${{ steps.asset.outputs.path }}")"
220+
221+ (
222+ cd "${release_dir}"
223+ shasum -a 256 \
224+ "$(basename -- "${{ steps.asset.outputs.path }}")" \
225+ "${installer_name}" \
226+ "${guide_name}" \
227+ "${bundle_name}" > "${checksums_name}"
228+ )
229+
230+ echo "wheel_path=${release_dir}/$(basename -- "${{ steps.asset.outputs.path }}")" >> "$GITHUB_OUTPUT"
231+ echo "installer_path=${release_dir}/${installer_name}" >> "$GITHUB_OUTPUT"
232+ echo "guide_path=${release_dir}/${guide_name}" >> "$GITHUB_OUTPUT"
233+ echo "bundle_path=${release_dir}/${bundle_name}" >> "$GITHUB_OUTPUT"
234+ echo "checksums_path=${release_dir}/${checksums_name}" >> "$GITHUB_OUTPUT"
235+
153236 - name : Generate release notes from changelog
154237 if : steps.state.outputs.release_exists == 'false'
155238 id : notes
@@ -159,6 +242,7 @@ jobs:
159242 import pathlib
160243 import re
161244 import sys
245+ from textwrap import dedent
162246
163247 tag = sys.argv[1]
164248 version = sys.argv[2]
@@ -189,7 +273,26 @@ jobs:
189273 if not notes_text:
190274 raise SystemExit(f"Changelog section for {tag} is empty")
191275
192- pathlib.Path("release-notes.md").write_text(notes_text + "\n", encoding="utf-8")
276+ install_section = dedent(
277+ f"""
278+ ## Install
279+
280+ Recommended: download the bundled install archive from this release and run:
281+
282+ ```bash
283+ curl -fsSLO https://github.com/${{ github.repository }}/releases/download/{tag}/github-report-install-{version}.tar.gz
284+ tar -xzf github-report-install-{version}.tar.gz
285+ bash ./install-github-report.sh
286+ ```
287+
288+ No git clone is required.
289+ """
290+ ).strip()
291+
292+ pathlib.Path("release-notes.md").write_text(
293+ notes_text + "\n\n" + install_section + "\n",
294+ encoding="utf-8",
295+ )
193296 PY
194297 echo "path=release-notes.md" >> "$GITHUB_OUTPUT"
195298
@@ -199,7 +302,12 @@ jobs:
199302 GH_TOKEN : ${{ github.token }}
200303 run : |
201304 set -euo pipefail
202- gh release create "${{ steps.version.outputs.tag }}" "${{ steps.asset.outputs.path }}" \
305+ gh release create "${{ steps.version.outputs.tag }}" \
306+ "${{ steps.package.outputs.wheel_path }}" \
307+ "${{ steps.package.outputs.installer_path }}" \
308+ "${{ steps.package.outputs.guide_path }}" \
309+ "${{ steps.package.outputs.bundle_path }}" \
310+ "${{ steps.package.outputs.checksums_path }}" \
203311 --title "${{ steps.version.outputs.tag }}" \
204312 --notes-file "${{ steps.notes.outputs.path }}"
205313
@@ -214,7 +322,11 @@ jobs:
214322 --arg tag "${{ steps.version.outputs.tag }}" \
215323 --arg version "${{ steps.version.outputs.version }}" \
216324 --arg sha "${{ steps.revision.outputs.commit }}" \
217- --arg asset "${{ steps.asset.outputs.path }}" \
325+ --arg wheel "${{ steps.package.outputs.wheel_path }}" \
326+ --arg installer "${{ steps.package.outputs.installer_path }}" \
327+ --arg guide "${{ steps.package.outputs.guide_path }}" \
328+ --arg bundle "${{ steps.package.outputs.bundle_path }}" \
329+ --arg checksums "${{ steps.package.outputs.checksums_path }}" \
218330 --arg run_id "${GITHUB_RUN_ID}" \
219331 --arg run_attempt "${GITHUB_RUN_ATTEMPT}" \
220332 --arg repository "${GITHUB_REPOSITORY}" \
@@ -226,7 +338,13 @@ jobs:
226338 tag: $tag,
227339 version: $version,
228340 sha: $sha,
229- asset: $asset,
341+ assets: {
342+ wheel: $wheel,
343+ installer: $installer,
344+ guide: $guide,
345+ bundle: $bundle,
346+ checksums: $checksums
347+ },
230348 run_id: $run_id,
231349 run_attempt: $run_attempt,
232350 timestamp_utc: now | todate
@@ -253,4 +371,11 @@ jobs:
253371 echo "- Version: \`${{ steps.version.outputs.version }}\`"
254372 echo "- Commit: \`${{ steps.revision.outputs.commit }}\`"
255373 echo "- Release exists: \`${{ steps.state.outputs.release_exists }}\`"
374+ if [[ "${{ steps.state.outputs.release_exists }}" == "false" ]]; then
375+ echo "- Wheel asset: \`${{ steps.package.outputs.wheel_path }}\`"
376+ echo "- Installer asset: \`${{ steps.package.outputs.installer_path }}\`"
377+ echo "- Install guide asset: \`${{ steps.package.outputs.guide_path }}\`"
378+ echo "- Bundle asset: \`${{ steps.package.outputs.bundle_path }}\`"
379+ echo "- Checksums asset: \`${{ steps.package.outputs.checksums_path }}\`"
380+ fi
256381 } >> "$GITHUB_STEP_SUMMARY"
0 commit comments