track staged publishing; use __exit__ only for cleanup.