Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • EOLE/infra/ci-tools
  • daniel.dehennin/ci-tools
2 results
Show changes
Commits on Source (7)
# Changelog
# [1.4.0](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/compare/release/1.3.0...release/1.4.0) (2022-01-24)
### Features
* **rules:** support prerelease tags for `semantic-release` ([0ec996a](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/commit/0ec996ac0072235cdca3fc51c2a1eb611d3b1665))
* **semantic-release/config:** easier declaration of branches ([c7acd28](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/commit/c7acd28195c7effa730ff20e2bc6de1d2f6991fc))
* **semantic-release:** new rules for prerelease ([b2752bd](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/commit/b2752bd900d23c554adf07b1feb54597f0dbd968))
# [1.3.0](https://gitlab.mim-libre.fr/EOLE/infra/ci-tools/compare/release/1.2.1...release/1.3.0) (2022-01-11)
......
......@@ -6,8 +6,32 @@
const branch = process.env.CI_COMMIT_REF_NAME;
const gitAssets = [];
// Configure your branches names
const stableBranch = 'stable';
// Assign a branch name to produce a `testing` prerelease tag
const testingBranch = undefined;
// Assign a branch name to produce a `dev` prerelease tag
const devBranch = undefined;
const semanticBranches = [stableBranch];
if (testingBranch) {
semanticBranches.push({
name: testingBranch,
prerelease: true
});
}
if (devBranch) {
semanticBranches.push({
name: devBranch,
prerelease: true
});
}
const config = {
branches: 'stable',
branches: semanticBranches,
/* eslint no-template-curly-in-string: "off" */
tagFormat: 'release/${version}',
plugins: [
......
......@@ -47,6 +47,9 @@
# We can't merge rules with `!reference` until we switch to Gitlab >= 14.3
# https://gitlab.com/gitlab-org/gitlab/-/issues/322992
# Use a `.rules-map` as a workaround
#
semantic-release:
extends: .semantic-release:stable
.on-stable-with-semantic-release-config:
rules:
......@@ -63,7 +66,37 @@
- .releaserc.js
when: on_success
semantic-release:
.on-testing-with-semantic-release-config:
rules:
- !reference [.rules-map, not-on-schedule]
- !reference [.rules-map, not-on-draft]
- !reference [.rules-map, not-on-semantic-release-commit]
- if: $CI_COMMIT_BRANCH == $TESTING_BRANCH
exists:
- release.config.js
- .releaserc
- .releaserc.yaml
- .releaserc.yml
- .releaserc.json
- .releaserc.js
when: on_success
.on-dev-with-semantic-release-config:
rules:
- !reference [.rules-map, not-on-schedule]
- !reference [.rules-map, not-on-draft]
- !reference [.rules-map, not-on-semantic-release-commit]
- if: $CI_COMMIT_BRANCH == $DEV_BRANCH
exists:
- release.config.js
- .releaserc
- .releaserc.yaml
- .releaserc.yml
- .releaserc.json
- .releaserc.js
when: on_success
.semantic-release:stable:
stage: release
extends: .on-stable-with-semantic-release-config
image: "$SEMANTIC_RELEASE_IMAGE"
......
......@@ -101,6 +101,20 @@ variables:
- !reference [.rules-map, not-on-draft]
- !reference [.rules-map, on-release-tag]
# Select the protected testing tags
.on-testing-tag:
rules:
- !reference [.rules-map, not-on-schedule]
- !reference [.rules-map, not-on-draft]
- !reference [.rules-map, on-testing-tag]
# Select the protected dev tags
.on-dev-tag:
rules:
- !reference [.rules-map, not-on-schedule]
- !reference [.rules-map, not-on-draft]
- !reference [.rules-map, on-dev-tag]
# We use a single rules hash to be referenced as array elements by
# individual rules templates above.
# This avoid the duplication of rules conditions
......@@ -152,6 +166,12 @@ variables:
if: $CI_COMMIT_TAG
when: on_success
on-release-tag:
if: $CI_COMMIT_TAG =~ /^release\// && $CI_COMMIT_REF_PROTECTED
if: $CI_COMMIT_TAG =~ /^release\/[0-9]+\.[0-9]+\.[0-9]+$/ && $CI_COMMIT_REF_PROTECTED
when: on_success
on-testing-tag:
if: $CI_COMMIT_TAG =~ /^release\/[0-9]+\.[0-9]+\.[0-9]+-testing/ && $CI_COMMIT_REF_PROTECTED
when: on_success
on-dev-tag:
if: $CI_COMMIT_TAG =~ /^release\/[0-9]+\.[0-9]+\.[0-9]+-dev/ && $CI_COMMIT_REF_PROTECTED
when: on_success
...