Based on the comments, the simplest suggestion I can think is something similar to the Nexus staging workflow, pointing the existing process as well as all downstream integration tests at a new 'staging' registry to ensure real users won't be exposed to untested artefacts.
On versioning, consider using the real release names and version scheme extended with an auto-generated build number for tracing back to a source tag and a pipeline run.
From a versioning point of view (assuming SemVer or some variation), it's reasonable to publish changes with the same Major/Minor/Patch version by including the generated build number at the end, i.e. "X.Y.Z+${build_number}"
(note: +
is the separator used by SemVer. ${}
is for string interpolation/substitution).
The last step for promoting the package could be as simple as copying it into the production registry; without modifying versions or artefacts (I would argue it's beneficial to be able to trace a public release back to its original pipeline run).
Roughly speaking, suggested changes to the CI Process, for each pipeline run triggered from trunk:
- Increment a persistent per-pipeline build counter upon each triggered run after the build runner checks out the changes.
- Extend the version core to generate a full version identifier by appending the build counter.
- At the end of any successful build, tag the commit with the full version identifier.
- Publish as before to the staging registry.
Many CI tools should have the facility to manage the build counter and version scheme straight out-the-box; if yours doesn't it's a fairly simple script to write.
If your package registry doesn't include the ability to promote releases (or if it's a feature you're not paying for) then that should also be a fairly simple script to download-then-upload for each artefact, knowing the build number which traces back to that specific pipeline run.