diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41b0db8..862e5f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,3 +22,48 @@ jobs: run: python -m pip install --upgrade pip && python -m pip install -e '.[dev]' - name: Run tests run: pytest -q + + release-candidate: + needs: pytest + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: '3.11' + - name: Build release candidate + run: python -m pip install --upgrade pip build && rm -rf dist && python -m build --wheel + - name: Verify release candidate bytes and package identity + run: | + python - <<'PY' + import hashlib + import json + import zipfile + from pathlib import Path + + release = json.loads(Path("docs/releases/0.0.1rc1.json").read_text(encoding="utf-8")) + artifact = release["artifact"] + wheel = Path("dist") / artifact["filename"] + assert wheel.is_file(), wheel + assert wheel.stat().st_size == artifact["size_bytes"] + assert hashlib.sha256(wheel.read_bytes()).hexdigest() == artifact["sha256"] + + with zipfile.ZipFile(wheel) as archive: + metadata_name = next(name for name in archive.namelist() if name.endswith(".dist-info/METADATA")) + metadata = archive.read(metadata_name).decode("utf-8") + version = next(line.split(": ", 1)[1] for line in metadata.splitlines() if line.startswith("Version: ")) + manifest_bytes = archive.read("hermes_workflows/plugin_payload_manifest.v1.json") + + assert version == release["version"] + manifest = json.loads(manifest_bytes) + expected_manifest = dict(release["package_resource_manifest"]) + identity = expected_manifest.pop("identity") + assert manifest == expected_manifest + assert identity == "sha256:" + hashlib.sha256(manifest_bytes).hexdigest() + PY + - uses: actions/upload-artifact@v6 + with: + name: hermes-workflows-0.0.1rc1-${{ github.sha }} + path: dist/hermes_workflows-0.0.1rc1-py3-none-any.whl + if-no-files-found: error + retention-days: 90 diff --git a/docs/releases/0.0.1rc1.json b/docs/releases/0.0.1rc1.json new file mode 100644 index 0000000..a6b3646 --- /dev/null +++ b/docs/releases/0.0.1rc1.json @@ -0,0 +1,36 @@ +{ + "artifact": { + "filename": "hermes_workflows-0.0.1rc1-py3-none-any.whl", + "immutable_url": "https://github.com/skylarbpayne/hermes-workflows/releases/download/v0.0.1rc1/hermes_workflows-0.0.1rc1-py3-none-any.whl", + "sha256": "9995dfcdfbb05057d21401896d94f3fdc9e89891f18fe6f6f6097c616e595ba2", + "size_bytes": 183555 + }, + "base_sha": "d99da904455a33a0406062289cad5ce5cea17fe2", + "consumes": { + "fnd_pkg": "e1e7a09e0c52702b4ab93e9a70520fd5ede4f9e3", + "fnd_regloc": "ad9e83091d72cab2f79b8324944d1dea4b740951" + }, + "package_resource_manifest": { + "files": [], + "identity": "sha256:8c7dc41504681d7acdc0b1a9e085e99fb4445c2e5440e6ea29077fb599aec3fc", + "owner_id": "hermes-workflows", + "package_name": "hermes-workflows", + "package_version": "0.0.1rc1", + "payload_root": "plugin_payload", + "schema_version": 1 + }, + "release_tag": "v0.0.1rc1", + "rollback": { + "artifact_bytes_replaced": false, + "strategy": "Revert the release metadata PR; if the artifact is bad, publish a new version. Never replace bytes at v0.0.1rc1." + }, + "runtime_mutation_receipt": { + "database": false, + "palmer_repository": false, + "profile": false, + "registry": false, + "service": false + }, + "schema_version": 1, + "version": "0.0.1rc1" +} diff --git a/pyproject.toml b/pyproject.toml index 3dc923d..759da8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "hermes-workflows" -version = "0.0.1" +version = "0.0.1rc1" description = "Code-first durable workflows for agent work, typed Review Queues, Workflow Workers, and receipts." readme = "README.md" requires-python = ">=3.9" diff --git a/src/hermes_workflows/plugin_payload_manifest.v1.json b/src/hermes_workflows/plugin_payload_manifest.v1.json index d53fee9..0e67581 100644 --- a/src/hermes_workflows/plugin_payload_manifest.v1.json +++ b/src/hermes_workflows/plugin_payload_manifest.v1.json @@ -1 +1 @@ -{"files":[],"owner_id":"hermes-workflows","package_name":"hermes-workflows","package_version":"0.0.1","payload_root":"plugin_payload","schema_version":1} \ No newline at end of file +{"files":[],"owner_id":"hermes-workflows","package_name":"hermes-workflows","package_version":"0.0.1rc1","payload_root":"plugin_payload","schema_version":1} \ No newline at end of file