Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,34 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
pattern: geometry_script-blender-*
path: dist
merge-multiple: true

# The release doubles as a static extension repository, so a link to one of
# its ZIPs with `?repository=./index.json` can be dropped into Blender.
# Blender's repository generator is a standalone script, so no Blender download is needed.
- name: Generate extension repository
run: |
curl -fsSL -o "$RUNNER_TEMP/blender_ext.py" \
https://raw.githubusercontent.com/blender/blender/v5.2.0/scripts/addons_core/bl_pkg/cli/blender_ext.py
python3 "$RUNNER_TEMP/blender_ext.py" server-generate --repo-dir dist
python3 tools/release_notes.py dist/index.json \
--base-url "https://github.com/${{ github.repository }}/releases/download/nightly/" \
--commit "${GITHUB_SHA::7}" > "$RUNNER_TEMP/notes.md"

- name: Publish nightly prerelease
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release delete nightly --yes --cleanup-tag || true
gh release create nightly dist/*.zip \
gh release create nightly dist/*.zip dist/index.json \
--prerelease \
--target "$GITHUB_SHA" \
--title "Nightly" \
--notes "Built from ${GITHUB_SHA::7}. Install the zip matching your Blender version from Preferences > Get Extensions > Install from Disk."
--notes-file "$RUNNER_TEMP/notes.md"
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ def repeat_grid(geometry: Geometry, width: int = 3, height: int = 3):
## Installation
Geometry Script is a Blender extension and requires Blender 5.2 or newer.

Drag the box for your Blender version into Blender to install it:

<p>
<a href="https://github.com/carson-katri/geometry-script/releases/download/nightly/geometry_script-1.0.0-blender-5.2.zip?repository=./index.json&amp;blender_version_min=5.2.0&amp;blender_version_max=5.3.0"><picture><source media="(prefers-color-scheme: dark)" srcset="book/src/images/install/blender-5.2-dark.svg"><img alt="Geometry Script for Blender 5.2" src="book/src/images/install/blender-5.2-light.svg" width="200" height="72"></picture></a>
<a href="https://github.com/carson-katri/geometry-script/releases/download/nightly/geometry_script-1.0.0-blender-5.3.zip?repository=./index.json&amp;blender_version_min=5.3.0&amp;blender_version_max=5.4.0"><picture><source media="(prefers-color-scheme: dark)" srcset="book/src/images/install/blender-5.3-dark.svg"><img alt="Geometry Script for Blender 5.3" src="book/src/images/install/blender-5.3-light.svg" width="200" height="72"></picture></a>
<a href="https://github.com/carson-katri/geometry-script/releases/download/nightly/geometry_script-1.0.0-blender-5.4.zip?repository=./index.json&amp;blender_version_min=5.4.0&amp;blender_version_max=5.5.0"><picture><source media="(prefers-color-scheme: dark)" srcset="book/src/images/install/blender-5.4-dark.svg"><img alt="Geometry Script for Blender 5.4" src="book/src/images/install/blender-5.4-light.svg" width="200" height="72"></picture></a>
</p>

Blender asks to allow online access if it's off, then to add the Geometry Script repository, then confirms the install. The [`nightly` release](https://github.com/carson-katri/geometry-script/releases/tag/nightly) always lists the links for every Blender version with a build.

To install manually instead:

1. Download the ZIP matching your Blender version from the [`nightly` release](https://github.com/carson-katri/geometry-script/releases/tag/nightly), e.g. `geometry_script-1.0.0-blender-5.2.zip`
2. Open *Blender* > *Preferences* > *Get Extensions*
3. Open the dropdown at the top right, choose *Install from Disk...* and select the downloaded ZIP file
Expand Down
7 changes: 7 additions & 0 deletions book/src/images/install/blender-5.2-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions book/src/images/install/blender-5.2-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions book/src/images/install/blender-5.3-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions book/src/images/install/blender-5.3-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions book/src/images/install/blender-5.4-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions book/src/images/install/blender-5.4-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions book/src/setup/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ Geometry Script is a Blender extension and requires **Blender 5.2** or newer.

Each build of the extension is generated for one Blender version, so its node functions match the nodes in that version exactly. Download the build that matches the version of Blender you use.

## Drag and drop
Drag the box for your Blender version into Blender:

<div class="extension-drops">
<a class="extension-drop" href="https://github.com/carson-katri/geometry-script/releases/download/nightly/geometry_script-1.0.0-blender-5.2.zip?repository=./index.json&amp;blender_version_min=5.2.0&amp;blender_version_max=5.3.0">
<span class="extension-drop-title">Blender 5.2</span>
<span class="extension-drop-hint">Drag into Blender</span>
</a>
<a class="extension-drop" href="https://github.com/carson-katri/geometry-script/releases/download/nightly/geometry_script-1.0.0-blender-5.3.zip?repository=./index.json&amp;blender_version_min=5.3.0&amp;blender_version_max=5.4.0">
<span class="extension-drop-title">Blender 5.3</span>
<span class="extension-drop-hint">Drag into Blender</span>
</a>
<a class="extension-drop" href="https://github.com/carson-katri/geometry-script/releases/download/nightly/geometry_script-1.0.0-blender-5.4.zip?repository=./index.json&amp;blender_version_min=5.4.0&amp;blender_version_max=5.5.0">
<span class="extension-drop-title">Blender 5.4</span>
<span class="extension-drop-hint">Drag into Blender</span>
</a>
</div>

Blender asks to allow online access if it's off, then offers to add the Geometry Script repository and install the extension. The [`nightly` release](https://github.com/carson-katri/geometry-script/releases/tag/nightly) lists the links for every Blender version with a build.

## From GitHub
1. Download the ZIP matching your Blender version from the [`nightly` release](https://github.com/carson-katri/geometry-script/releases/tag/nightly), e.g. `geometry_script-1.0.0-blender-5.2.zip`
2. Open *Blender* > *Preferences* > *Get Extensions*
Expand Down
40 changes: 39 additions & 1 deletion book/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
.coal {
--bg: #1C1C1C !important;
}
}
.extension-drops {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin: 16px 0;
}

.extension-drops a.extension-drop {
display: flex;
flex-direction: column;
gap: 4px;
flex: 1 1 140px;
padding: 16px;
border: 2px dashed var(--links);
border-radius: 8px;
text-decoration: none;
text-align: center;
cursor: grab;
}

.extension-drops a.extension-drop:hover {
background: var(--theme-hover);
text-decoration: none;
}

.extension-drops a.extension-drop:active {
cursor: grabbing;
}

.extension-drop-title {
color: var(--fg);
font-weight: bold;
}

.extension-drop-hint {
color: var(--icons);
font-size: 0.85em;
}
57 changes: 57 additions & 0 deletions tools/release_notes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""Print the release notes for a build with a drag and drop link per Blender series.

python tools/release_notes.py dist/index.json --base-url https://github.com/<repo>/releases/download/<tag>/

``index.json`` is the extension repository listing written by Blender's
``extension server-generate`` next to the ZIP files. Dropping one of the links
into Blender offers to add that repository and install the matching build.
"""

from __future__ import annotations

import argparse
import json
import sys
import urllib.parse
from pathlib import Path


def drop_url(base_url: str, package: dict[str, str]) -> str:
query = {"repository": "./index.json", "blender_version_min": package["blender_version_min"]}
if "blender_version_max" in package:
query["blender_version_max"] = package["blender_version_max"]
archive = package["archive_url"].removeprefix("./")
return f"{base_url.rstrip('/')}/{archive}?{urllib.parse.urlencode(query, safe='/')}"


def main() -> int:
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument("index", type=Path, help="Repository listing (index.json)")
parser.add_argument("--base-url", required=True, help="URL the ZIP files and index.json are served from")
parser.add_argument("--commit", default="", help="Commit the packages were built from")
args = parser.parse_args()

packages = json.loads(args.index.read_text(encoding="utf-8"))["data"]
packages.sort(key=lambda package: tuple(int(part) for part in package["blender_version_min"].split(".")))

lines = []
if args.commit:
lines += [f"Built from {args.commit}.", ""]
lines += [
"Drag the link for your Blender version into Blender to install it:",
"",
]
for package in packages:
series = ".".join(package["blender_version_min"].split(".")[:2])
lines.append(f"- [Geometry Script for Blender {series}]({drop_url(args.base_url, package)})")
lines += [
"",
"Or download the ZIP matching your Blender version and install it from "
"Preferences > Get Extensions > Install from Disk.",
]
print("\n".join(lines))
return 0


if __name__ == "__main__":
sys.exit(main())
Loading