@wyardley I recommend taking a look at some of the automated publishing processes in our open-source orb repos—we’re still working out a 100% best practice, but there’s a lot of good iterations. For example, from the monorepo:
workflows:
version: 2
main:
jobs:
- lint
- build
- dev-release:
requires:
- build
- lint
- trigger-downstream:
requires:
- dev-release
filters:
branches:
only: master
context: orb-publishing
- hold:
type: approval
requires:
- trigger-downstream
filters:
branches:
only: master
- dev-promote-patch:
requires:
- hold
filters:
branches:
only: master
context: orb-publishing
and, in detail, a dev release command:
circleci orb publish ${ORB}orb.yml circleci/${orbname}@dev:${CIRCLE_BRANCH}-${CIRCLE_SHA1} --token $CIRCLECI_API_TOKEN
and prod release command:
circleci orb publish promote circleci/${orbname}@dev:${CIRCLE_BRANCH}-${CIRCLE_SHA1} patch --token $CIRCLECI_API_TOKEN
(${orbname}
because these commands are running in a loop within the monorepo and being applied to multiple orbs.)
Or, a simpler, single-orb example:
The key thing to note is: if you automate your publishing, you can dev-publish with the commit hash appended to the tag, and then use that same commit hash in your later job to promote the orb to prod.
This process will get firmed up in the coming months, I think, and when we have something that feels established enough, we can describe it more officially in our documentation.
We also provide the Orb Tools Orb to help folks with this process:
https://circleci.com/orbs/registry/orb/circleci/orb-tools
What it provides doesn’t quite match the previous examples, but that’s an example of our best practices still being a bit in flux. We’ll continue actively developing the orb tools orb, as well, to make it as easy as possible for end users to automate their own orb building/testing/publishing on CircleCI.
Thanks!