@@ -530,34 +530,86 @@ installed = list_installed()
530530
531531### Source program integration
532532
533- For program repositories to integrate:
534-
535- 1. **Generate registry metadata**:
536- ```bash
537- # In program repository
538- python -m modflow_devtools.make_program_registry \
539- --version 6.6.3 \
540- --platforms linux mac win64 \
541- --output .registry/registry.toml
542- ```
543-
544- 2. **Publish registry**: Attach `registry.toml` as a release asset
545-
546- 3. **Example CI integration** (GitHub Actions):
547- ```yaml
548- - name: Generate program registry
549- run: |
550- python -m modflow_devtools.make_program_registry \
551- --version ${{ github.ref_name }} \
552- --platforms linux mac win64 \
553- --output registry.toml
554-
555- - name: Upload registry to release
556- uses: actions/upload-release-asset@v1
557- with:
558- asset_path: registry.toml
559- asset_name: registry.toml
560- ```
533+ For program repositories to integrate, they can generate registry files in two ways:
534+
535+ #### Mode 1: Local Assets (CI/Build Pipeline)
536+
537+ Use this mode when you have local distribution files during CI builds:
538+
539+ ```bash
540+ # Generate registry from local distribution files
541+ python -m modflow_devtools.programs.make_registry \
542+ --dists *.zip \
543+ --programs mf6 zbud6 libmf6 mf5to6 \
544+ --version 6.6.3 \
545+ --repo MODFLOW-ORG/modflow6 \
546+ --compute-hashes \
547+ --output programs.toml
548+ ```
549+
550+ **How it works:**
551+ - Uses `--dists` to specify a glob pattern for local distribution files (e.g., `*.zip`)
552+ - Scans the local filesystem for matching files
553+ - Requires `--version` and `--repo` arguments
554+ - Optionally computes SHA256 hashes from local files with `--compute-hashes`
555+ - Creates asset entries from local file names
556+ - Auto-detects platform from file names (linux, mac, win64, etc.)
557+
558+ **Example CI integration** (GitHub Actions):
559+ ```yaml
560+ - name: Generate program registry
561+ run: |
562+ python -m modflow_devtools.programs.make_registry \
563+ --dists *.zip \
564+ --programs mf6 zbud6 libmf6 mf5to6 \
565+ --version ${{ github.ref_name }} \
566+ --repo ${{ github.repository }} \
567+ --compute-hashes \
568+ --output programs.toml
569+
570+ - name: Upload registry to release
571+ uses: softprops/action-gh-release@v1
572+ with:
573+ files: programs.toml
574+ ```
575+
576+ #### Mode 2: GitHub Release (Testing/Regeneration)
577+
578+ Use this mode to generate a registry from an existing GitHub release:
579+
580+ ```bash
581+ # Generate registry from existing GitHub release
582+ python -m modflow_devtools.programs.make_registry \
583+ --repo MODFLOW-ORG/modflow6 \
584+ --version 6.6.3 \
585+ --programs mf6 zbud6 libmf6 mf5to6 \
586+ --output programs.toml
587+ ```
588+
589+ **How it works:**
590+ - Fetches release assets from GitHub API using repo and version (tag)
591+ - Downloads assets if `--compute-hashes` is specified
592+ - Useful for testing or regenerating a registry for an existing release
593+ - No `--dists` argument needed - pulls from GitHub directly
594+
595+ **Additional options:**
596+ ```bash
597+ # With custom executable paths (if not bin/{program})
598+ python -m modflow_devtools.programs.make_registry \
599+ --dists *.zip \
600+ --programs mf6:bin/mf6 zbud6:bin/zbud6 custom:path/to/exe \
601+ --version 6.6.3 \
602+ --repo MODFLOW-ORG/modflow6
603+
604+ # With description and license metadata
605+ python -m modflow_devtools.programs.make_registry \
606+ --dists *.zip \
607+ --programs mf6 \
608+ --version 6.6.3 \
609+ --repo MODFLOW-ORG/modflow6 \
610+ --description "MODFLOW 6 groundwater flow model" \
611+ --license "CC0-1.0"
612+ ```
561613
562614### Program addressing
563615
0 commit comments