diff --git a/README.md b/README.md index 39a8e8651a3666e7c073110bdf1dbe2b7bbd5fd3..f66e07437ecf8b20dab0e2f4a1da188bcc606e41 100644 --- a/README.md +++ b/README.md @@ -85,19 +85,25 @@ If no configuration is found, the template will generate one with the following As specified in the previous chapter, these variables are only used to generated a `.releaserc` when no configuration is found in the repository. -| Input / Variable | Description | Default value | -| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| `changelog-enabled` / `SEMREL_CHANGELOG_ENABLED` | Add the [@semantic-release/changelog](https://github.com/semantic-release/changelog) plugin which will commit a changelog file in the repository if set to `true`. | _none_ | -| `changelog-file` / `SEMREL_CHANGELOG_FILE` | [changelogFile @semantic-release/changelog option](https://github.com/semantic-release/changelog#options). | _none_ (use the plugin default value which is `CHANGELOG.md`). | -| `changelog-title` / `SEMREL_CHANGELOG_TITLE` | [changelogTitle @semantic-release/changelog option](https://github.com/semantic-release/changelog#options). You might want to use markdown format (for example `# MyApp Changelog`). | _none_ | -| `dry-run` / `SEMREL_DRY_RUN` | Activate the [dryRun semantic-release option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#dryrun) if present. | _none_ | -| `extra-args` / `SEMREL_EXTRA_ARGS` | [Extra options](https://semantic-release.gitbook.io/semantic-release/usage/configuration#options) to pass to semantic-release. | _none_ | -| `auto-release-enabled` / `SEMREL_AUTO_RELEASE_ENABLED` | When set to `true` the job start automatically. When not set (default), the job is manual. | _none_ | -| `branches-ref` / `SEMREL_BRANCHES_REF` | Regular expression pattern matching branches from which releases should happen (should match your [semantic-release configuration](https://semantic-release.gitbook.io/semantic-release/usage/configuration#branches)) | `/^(master\|main)$/` | -| `tag-format` / `SEMREL_TAG_FORMAT` | [tagFormat semantic-release option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#tagformat). :warning: don't forget to double the `$` character so it is not interpreted by GitLab. | `$${version}` | -| `hooks-dir` / `SEMREL_HOOKS_DIR` | [Hook scripts](#hook_scripts) folder. | `.` | -| `commit-message` / `SEMREL_COMMIT_MESSAGE` | Add a custom commit message based on [semantic-release/git option](https://github.com/semantic-release/git#message). | _none_ (uses semantic-release default commit message) | -| `release-disabled` / `SEMREL_RELEASE_DISABLED` | Disable this job. | _none_ | +| Input / Variable | Description | Default value | +| -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `changelog-enabled` / `SEMREL_CHANGELOG_ENABLED` | Add the [@semantic-release/changelog](https://github.com/semantic-release/changelog) plugin which will commit a changelog file in the repository if set to `true`. | _none_ | +| `changelog-file` / `SEMREL_CHANGELOG_FILE` | [changelogFile @semantic-release/changelog option](https://github.com/semantic-release/changelog#options). | _none_ (use the plugin default value which is `CHANGELOG.md`). | +| `changelog-title` / `SEMREL_CHANGELOG_TITLE` | [changelogTitle @semantic-release/changelog option](https://github.com/semantic-release/changelog#options). You might want to use markdown format (for example `# MyApp Changelog`). | _none_ | +| `dry-run` / `SEMREL_DRY_RUN` | Activate the [dryRun semantic-release option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#dryrun) if present. | _none_ | +| `extra-args` / `SEMREL_EXTRA_ARGS` | [Extra options](https://semantic-release.gitbook.io/semantic-release/usage/configuration#options) to pass to semantic-release. | _none_ | +| `auto-release-enabled` / `SEMREL_AUTO_RELEASE_ENABLED` | When set to `true` the job start automatically. When not set (default), the job is manual. | _none_ | +| `branches-ref` / `SEMREL_BRANCHES_REF` | Regular expression pattern matching branches from which releases should happen (should match your [semantic-release configuration](https://semantic-release.gitbook.io/semantic-release/usage/configuration#branches)) | `/^(master\|main)$/` | +| `tag-format` / `SEMREL_TAG_FORMAT` | [tagFormat semantic-release option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#tagformat). :warning: don't forget to double the `$` character so it is not interpreted by GitLab. | `$${version}` | +| `hooks-dir` / `SEMREL_HOOKS_DIR` | [Hook scripts](#hook_scripts) folder. | `.` | +| `commit-message` / `SEMREL_COMMIT_MESSAGE` | Add a custom commit message based on [semantic-release/git option](https://github.com/semantic-release/git#message). | _none_ (uses semantic-release default commit message) | +| `release-disabled` / `SEMREL_RELEASE_DISABLED` | Disable this job. | _none_ | +| `commit-analyzer-plugin` / `SEMREL_COMMIT_ANALYZER_PLUGIN` | NPM plugin name for the [commit-analyzer](https://github.com/semantic-release/commit-analyzer#commit-analyzer) plugin | `@semantic-release/commit-analyzer` | +| `release-notes-generator-plugin` / `SEMREL_RELEASE_NOTES_GENERATOR_PLUGIN` | NPM plugin name for the [release-notes-generator](https://github.com/semantic-release/release-notes-generator#release-notes-generator) plugin | `@semantic-release/release-notes-generator` | +| `gitlab-plugin` / `SEMREL_GITLAB_PLUGIN` | NPM plugin name for the [gitlab](https://github.com/semantic-release/gitlab#semantic-releasegitlab) plugin | `@semantic-release/gitlab` | +| `changelog-plugin` / `SEMREL_CHANGELOG_PLUGIN` | NPM plugin name for the [changelog](https://github.com/semantic-release/changelog#semantic-releasechangelog) plugin | `@semantic-release/changelog` | +| `git-plugin` / `SEMREL_GIT_PLUGIN` | NPM plugin name for the [git](https://github.com/semantic-release/git#semantic-releasegit) plugin | `@semantic-release/git` | +| `exec-plugin` / `SEMREL_EXEC_PLUGIN` | NPM plugin name for the [exec](https://github.com/semantic-release/exec#semantic-releaseexec) plugin | `@semantic-release/exec` | #### Hook scripts diff --git a/kicker.json b/kicker.json index ecf477be33158d319d522f2afc1de96a4d3bc3be..79256f5f6147c85fe73ed4eb1c8938d1e9f137af 100644 --- a/kicker.json +++ b/kicker.json @@ -117,6 +117,42 @@ "values": ["angular","codemirror","conventionalcommits","ember","eslint","express","jquery","jshint"], "default": "angular", "advanced": true + }, + { + "name": "SEMREL_COMMIT_ANALYZER_PLUGIN", + "description": "NPM plugin name for the commit-analyzer plugin.", + "default": "@semantic-release/commit-analyzer", + "advanced": true + }, + { + "name": "SEMREL_RELEASE_NOTES_GENERATOR_PLUGIN", + "description": "NPM plugin name for the release-notes-generator plugin.", + "default": "@semantic-release/release-notes-generator", + "advanced": true + }, + { + "name": "SEMREL_GITLAB_PLUGIN", + "description": "NPM plugin name for the gitlab plugin.", + "default": "@semantic-release/gitlab", + "advanced": true + }, + { + "name": "SEMREL_CHANGELOG_PLUGIN", + "description": "NPM plugin name for the changelog plugin.", + "default": "@semantic-release/changelog", + "advanced": true + }, + { + "name": "SEMREL_GIT_PLUGIN", + "description": "NPM plugin name for the git plugin.", + "default": "@semantic-release/git", + "advanced": true + }, + { + "name": "SEMREL_EXEC_PLUGIN", + "description": "NPM plugin name for the exec plugin.", + "default": "@semantic-release/exec", + "advanced": true } ] }, diff --git a/templates/gitlab-ci-semrel.yml b/templates/gitlab-ci-semrel.yml index 051e44e369d9e8c5785159e291b6b9181a92d8ba..4814da0552ce3392c736a5656cac200b2211f95a 100644 --- a/templates/gitlab-ci-semrel.yml +++ b/templates/gitlab-ci-semrel.yml @@ -89,6 +89,25 @@ spec: - protected - all default: '' + commit-analyzer-plugin: + description: The npm plugin name for the commit-analyzer plugin. The default is `@semantic-release/commit-analyzer` + default: '@semantic-release/commit-analyzer' + release-notes-generator-plugin: + description: The npm plugin name for the release-notes-generator plugin. The default is `@semantic-release/release-notes-generator` + default: '@semantic-release/release-notes-generator' + gitlab-plugin: + description: The npm plugin name for the gitlab plugin. The default is `@semantic-release/gitlab` + default: '@semantic-release/gitlab' + changelog-plugin: + description: The npm plugin name for the changelog plugin. The default is `@semantic-release/changelog` + default: '@semantic-release/changelog' + git-plugin: + description: The npm plugin name for the git plugin. The default is `@semantic-release/git` + default: '@semantic-release/git' + exec-plugin: + description: The npm plugin name for the exec plugin. The default is `@semantic-release/exec` + default: '@semantic-release/exec' + --- workflow: rules: @@ -144,6 +163,13 @@ variables: SEMREL_INFO_ON: $[[ inputs.info-on ]] SEMREL_COMMIT_SPEC: $[[ inputs.commit-spec ]] + SEMREL_COMMIT_ANALYZER_PLUGIN: $[[ inputs.commit-analyzer-plugin ]] + SEMREL_RELEASE_NOTES_GENERATOR_PLUGIN: $[[ inputs.release-notes-generator-plugin ]] + SEMREL_GITLAB_PLUGIN: $[[ inputs.gitlab-plugin ]] + SEMREL_CHANGELOG_PLUGIN: $[[ inputs.changelog-plugin ]] + SEMREL_GIT_PLUGIN: $[[ inputs.git-plugin ]] + SEMREL_EXEC_PLUGIN: $[[ inputs.exec-plugin ]] + # default production ref name (pattern) PROD_REF: /^(master|main)$/ SEMREL_BRANCHES_REF: $[[ inputs.branches-ref ]] @@ -506,11 +532,11 @@ stages: echo "tagFormat: '${SEMREL_TAG_FORMAT}'" echo "" echo "plugins: " - echo " - - '@semantic-release/commit-analyzer'" + echo " - - '${SEMREL_COMMIT_ANALYZER_PLUGIN}'" echo "${commitPresetConfig}" - echo " - - '@semantic-release/release-notes-generator'" + echo " - - '${SEMREL_RELEASE_NOTES_GENERATOR_PLUGIN}'" echo "${commitPresetConfig}" - echo " - '@semantic-release/gitlab'" + echo " - '${SEMREL_GITLAB_PLUGIN}'" echo "${changelogPluginConfig}" echo "${execPluginConfig}" echo "${gitPluginConfig}" @@ -583,10 +609,10 @@ stages: if [[ -n "${SEMREL_CHANGELOG_TITLE}" ]]; then changeLogConfig=$(echo -e "${changeLogConfig:+${changeLogConfig}\n }changelogTitle: '${SEMREL_CHANGELOG_TITLE}'") fi - echo " - - '@semantic-release/changelog'" + echo " - - '${SEMREL_CHANGELOG_PLUGIN}'" echo " - ${changeLogConfig}" else - echo " - '@semantic-release/changelog'" + echo " - '${SEMREL_CHANGELOG_PLUGIN}'" fi else echo "" @@ -597,7 +623,7 @@ stages: function generate_git_plugin_conf() { # git plugin has default changelog file as asset by default so # we need to add it explicitly if the user configured a custom changelogFile - echo " - - '@semantic-release/git'" + echo " - - '${SEMREL_GIT_PLUGIN}'" if [[ "${SEMREL_CHANGELOG_ENABLED}" = "true" ]] && [[ -n "${SEMREL_CHANGELOG_FILE}" ]]; then echo " - assets:" echo " - '${SEMREL_CHANGELOG_FILE}'" @@ -655,7 +681,7 @@ stages: tabs=" " fi if [[ -n "${scriptsConfig}" ]]; then - echo " - - '@semantic-release/exec'" + echo " - - '${SEMREL_EXEC_PLUGIN}'" echo "${scriptsConfig}" else echo "" @@ -729,9 +755,9 @@ stages: echo "# injected (replace your plugins) plugins by the template to generate dotenv" echo "" echo "plugins:" - echo " - - '@semantic-release/commit-analyzer'" + echo " - - '${SEMREL_COMMIT_ANALYZER_PLUGIN}'" echo "${commitPresetConfig}" - echo " - - '@semantic-release/exec'" + echo " - - '${SEMREL_EXEC_PLUGIN}'" echo " - analyzeCommitsCmd: '\"${export_last_version_hook_script}\" \"\${lastRelease.version}\"'" echo " verifyReleaseCmd: '\"${export_next_version_hook_script}\" \"\${nextRelease.version}\" \"\${nextRelease.type}\"'" echo "" @@ -744,7 +770,7 @@ stages: cat ".releaserc" fi - npm install --global "semantic-release@${SEMREL_VERSION}" "@semantic-release/exec@${SEMREL_EXEC_VERSION}" + npm install --global "semantic-release@${SEMREL_VERSION}" "${SEMREL_EXEC_PLUGIN}@${SEMREL_EXEC_VERSION}" semantic-release --dry-run # Rollback temporary semantic-release configuration