Exclude python, contrib, and samples from the build. Clean up unnecessary dependencies installation. Publish artifacts.