I wrote a workflow to fetch the source code from the repo, build it, and create the release as an asset. Then the source code is pristine, but users can still download the software for installation in production.
I describe step-by-step an action to build a WordPress plugin, and the same concept works for anything.