add condition to only upload archives if ourJar did work (which is false if jar has not changed), so we avoid unnecessary artefact uploads
moved sonatype artifacts upload to separate file
rerun reset-env in case it was changed by last pull