Commit 9db709ad authored by Gaëtan Montury's avatar Gaëtan Montury
Browse files

feat: add auto-release as an optional feature for releases

parent ce84eb01
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -403,6 +403,7 @@ The release job is bound to the `publish` stage, appears only on production and
| Input / Variable        | Description                                                             | Default value     |
| ----------------------- | ----------------------------------------------------------------------- | ----------------- |
| `release-enabled` / `PYTHON_RELEASE_ENABLED`| Set to `true` to enable the release job                                 | _none_ (disabled) |
| `auto-release-enabled` / `PYTHON_AUTO_RELEASE_ENABLED`| When set the job start automatically on production branch. When not set (default), the job is manual. Note that this behavior also depends on release-enabled being set. | _none_ (disabled) |
| `release-next` / `PYTHON_RELEASE_NEXT`   | The part of the version to increase (one of: `major`, `minor`, `patch`) | `minor`           |
| `semrel-release-disabled` / `PYTHON_SEMREL_RELEASE_DISABLED`| Set to `true` to disable [semantic-release integration](#semantic-release-integration)   | _none_ (disabled) |
| `GIT_USERNAME`          | Git username for Git push operations (see below)                        | _none_            |
+6 −0
Original line number Diff line number Diff line
@@ -187,6 +187,12 @@
      "description": "Manually trigger a release of your code (uses [bumpversion](https://pypi.org/project/bumpversion/))",
      "enable_with": "PYTHON_RELEASE_ENABLED",
      "variables": [
        {
          "name": "PYTHON_AUTO_RELEASE_ENABLED",
          "description": "When set the job start automatically. When not set (default), the job is manual. Note that this behavior also depends on release-enabled being set.",
          "type": "boolean",
          "advanced": true
        },        
        {
          "name": "PYTHON_RELEASE_NEXT",
          "type": "enum",
+7 −0
Original line number Diff line number Diff line
@@ -130,6 +130,10 @@ spec:
      description: Enable Release
      type: boolean
      default: false
    auto-release-enabled:
      description: When set the job start automatically on production branch. When not set (default), the job is manual. Note that this behavior also depends on release-enabled being set.
      type: boolean
      default: false
    publish-enabled:
      description: Enable Publish Package
      type: boolean
@@ -292,6 +296,7 @@ variables:
  PYTHON_SBOM_DISABLED: $[[ inputs.sbom-disabled ]]
  PYTHON_RELEASE_ENABLED: $[[ inputs.release-enabled ]]
  PYTHON_PUBLISH_ENABLED: $[[ inputs.publish-enabled ]]
  PYTHON_AUTO_RELEASE_ENABLED: $[[ inputs.auto-release-enabled ]]

  PYTHON_BLACK_ENABLED: $[[ inputs.black-enabled ]]
  PYTHON_ISORT_ENABLED: $[[ inputs.isort-enabled ]]
@@ -1387,6 +1392,8 @@ py-release:
    # exclude if $PYTHON_RELEASE_ENABLED not set
    - if: '$PYTHON_RELEASE_ENABLED != "true"'
      when: never
    # on production branch: auto if $PYTHON_AUTO_RELEASE_ENABLED set and implicitly $PYTHON_RELEASE_ENABLED set
    - if: '$PYTHON_AUTO_RELEASE_ENABLED == "true" && $CI_COMMIT_REF_NAME =~ $PROD_REF'
    # on production or integration branch: manual, non blocking
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF'
      when: manual