CircleCI-Public / orb-tools-orb

Various tools for authoring and publishing CircleCI orbs
https://circleci.com/orbs/registry/orb/circleci/orb-tools
MIT License
51 stars 74 forks source link

Tag spec for publishing is too restrictive and not up to semver specs #163

Closed georgehwho closed 1 year ago

georgehwho commented 1 year ago

Orb version:

11.1

What happened:

I tried to deploy a private orb with the tag v0.0.0-alpha-1 and received the following error in the Publishing Orb Release step

Malformed tag detected.
Tag: v0.0.0-alpha-1

Ensure your tag fits the standard semantic version form. Example: v1.0.0
Aborting deployment. Push a new tag with the compatible form.

Expected behavior:

Per Semver's spec: https://semver.org/

A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92, 1.0.0-x-y-z.–.

The example shows 1.0.0-alpha.1, but 0.0.0-alpha-1 also meets that requirement so I expected my tag to work.

Additional Information:

Looks like the function validateProdTag here is restricting the tag: https://github.com/CircleCI-Public/orb-tools-orb/blob/master/src/scripts/publish.sh#L2

KyleTryon commented 1 year ago

Hello George,

CircleCI's orbs do not have full semver support. A CircleCI orb can only be published as a numbered version X.Y.Z, or with a dev tag, such as namespace/orb-name@dev:x. Orbs can also be called via @volatile for the last published release (does not respect version numbers). So unfortunately it is not a limitation of this orb or tool, it is the design of the orbs product.

More information can be found here: https://circleci.com/docs/orb-concepts#semantic-versioning

If you are attempting to publish an alpha version of an orb, I recommend using a dev tag. This however is not supported by the automatic deployment job currently, due to the default tag regex.