CI Upload build artefact to Gitlab Packages
Resources
- Gitlab-CI Choose when to run jobs
Release procedure
- create a tag
- grab values
- grab version (
releaseVersion
), which is the tag - grab
major
as major digit of the tag (see official regexp from semver.org) - Define
nextDevVersion
as${major}-SNAPSHOT
- grab version (
maven versions:set $releaseVersion
- build+test
- create package
- create a release
maven versions:set $nextDevVersion
- we do NOT want to deploy automatically yet
When to run this procedure:
- when a tag is pushed
if: $CI_COMMIT_TAG
. See Commonif
clauses forrules
- when the tag is like a semver version (grab official regexp from Semver.org). See Compare a variable to a regex pattern. Or use the simpler form
only: tag
.
For any other situation different from a semver tag (MR, branch, other tag):
- follow the usual CI (build+test)
- do not create a package, the build artifact is sufficient (moreover, artifact expires and thus saves disk space)
- do not create a release
- leave version as
-SNAPSHOT
- auto-deploy to dev platform
Edited by Matthieu FAURE