This repository is a learning template for building and publishing Application Packages. It demonstrates how to describe a command-line tool and workflow in CWL, package the tool in a container, and publish versioned, reproducible releases. Use it as a starting point: adapt the example code, CWL descriptions, and metadata for your own application.
The example application is a small Python program that splits a string into words, sorts them alphabetically without regard to case, and writes the result to a file. It uses only the Python standard library.
python process_data.py "pear apple Banana" sorted.txtThe output file contains apple Banana pear on one line. The original spelling
of each word is kept.
docker build -t word-sorter .
docker run --rm -v "$PWD:/output" word-sorter word-sorter "pear apple Banana" /output/sorted.txtThe sorted result is written to sorted.txt in the current directory. The
image has no entry point: the command word-sorter is given explicitly, as
the CWL baseCommand does.
The checked-in CWL files use <owner> and <repo> as placeholders for the
GitHub repository owner and name. Replace them with your repository's values
before running the files directly. Tagged releases substitute both
automatically.
Published images: ghcr.io/<owner>/<repo> (tags X.Y.Z, edge
for main, sha-<commit>), with SBOM, SLSA provenance and a cosign
signature. Verify an image with:
OWNER=your-github-owner
REPO=your-repository-name
TAG=0.1.0
gh attestation verify "oci://ghcr.io/${OWNER}/${REPO}:${TAG}" --owner "$OWNER"cwltool tool.cwl#word_sorter --text "pear apple Banana"
cwltool workflow.cwl#word_sorter_pipeline --text "pear apple Banana"-
Choose a new semantic version, such as
0.2.0. -
Update every
s:softwareVersionvalue intool.cwlandworkflow.cwlto that version. This example has three values: one for the workflow and one for each tool definition. Do not manually updatedockerPull; the release workflow sets it to the published image for this version, pinned by digest. -
Commit and push the changes to your default branch.
-
Create and push a matching version tag:
git tag v0.2.0 git push origin v0.2.0
The tag must be v followed by the version, and the CWL s:softwareVersion
values must match it without the v prefix. The GitHub Actions workflow builds
and publishes the container, updates dockerPull in the release CWL files to
the image tagged with that version and pinned by digest, then attaches
tool.0.2.0.cwl and workflow.0.2.0.cwl to the GitHub release. These released
Application Packages can be deployed on an OGC API - Processes server.