Anomaly-free supergravity and super-Yang-Mills theories in ten dimensions