I have a simple workflow that has a build job, a hold (type approval), then a release job.
If I perform a checkout in the build job and the release job, will they always use the same SHA and get the same code?
Context:
I have a Clojure library I want to release to Clojars. I don’t want every commit to automatically get deployed so that is why I added the manual approval step.
I build a jar in the build job and store it as an artefact, as its nice to be able to manually download a CI built jar if required.
Originally I also persisted the jar to the workspace which I restored in the release step. I then tried to use lein deploy to push this prebuilt jar to Clojars. However lein rebuilds the jar which meant it contained no source files and was completely broken!
So my options seem to be:
- try and stop lein from rebuilding the jar
- persist the src to the workspace
- checkout the same SHA again
If checking out code in different workflow jobs is smart enough to use the same SHA that seemed like the simplest option, but was unable to find a definitive answer, hence my question!