Skip to content

feat: complete TextMate Extensions rendering layer #59

feat: complete TextMate Extensions rendering layer

feat: complete TextMate Extensions rendering layer #59

Workflow file for this run

# SPDX-License-Identifier: GPL-2.0-only
#
# Project: Ecli
# File: .github/workflows/pypi-validate.yml
# Website: https://www.ecli.io
# Repository: https://github.com/SSobol77/ecli
# PyPI: https://pypi.org/project/ecli-editor/0.0.1/
#
# Copyright (c) 2026 Siergej Sobolewski
#
# Licensed under the GNU General Public License version 2 only.
# See the LICENSE file in the project root for full license text.
name: PyPI Contract Validate
"on":
workflow_dispatch:
pull_request:
branches: [main]
paths:
- ".github/workflows/pypi-validate.yml"
- "Makefile"
- "pyproject.toml"
- "src/**"
- "tests/**"
permissions:
contents: read
concurrency:
group: pypi-validate-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Verify PyPI namespace ownership
run: |
set -e
name=$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["name"])')
if [ "$name" != "ecli-editor" ]; then
echo "::error::pyproject.toml [project].name is '$name', expected 'ecli-editor'."
echo "::error::Reserved PyPI namespace is 'ecli-editor'. Either update pyproject.toml or reserve the new name first."
exit 1
fi
lookup=$(python3 -m pip index versions ecli-editor 2>&1 || true)
if ! echo "$lookup" | grep -q "Available versions"; then
echo "::error::PyPI project 'ecli-editor' lookup failed. Network issue or namespace deletion?"
echo "$lookup"
exit 1
fi
echo "::notice::PyPI namespace ecli-editor confirmed. Current versions:"
echo "$lookup"
- name: Install uv
run: pipx install uv
- name: Sync dependencies
run: uv sync --extra dev
- name: Build PyPI distributions
run: uv run make PYTHON="uv run python" package-pypi
- name: Verify corrupted sidecar is rejected
shell: bash
run: |
set -euo pipefail
wheel_sha="$(python3 - <<'PY'
import tomllib
with open("pyproject.toml", "rb") as f:
project = tomllib.load(f)["project"]
wheel_name = project["name"].replace("-", "_")
version = project["version"]
print(f"releases/{version}/{wheel_name}-{version}-py3-none-any.whl.sha256")
PY
)"
cp "$wheel_sha" "$wheel_sha.bak"
awk '{print "ffff" substr($1, 5) " " $2}' "$wheel_sha.bak" > "$wheel_sha"
set +e
uv run make PYTHON="uv run python" validate-pypi-contract > tamper.log 2>&1
rc=$?
set -e
cat tamper.log
mv "$wheel_sha.bak" "$wheel_sha"
test "$rc" -ne 0
grep -q "Error 4" tamper.log
- name: Validate PyPI contract
run: uv run make PYTHON="uv run python" validate-pypi-contract