Skip to main content

On This Page

Manual Version Bumps Using Semantic Release with Azure DevOps

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

Azure DevOps Pipeline for Manual bumping

The semantic-release package automates version management, but some teams require manual control over major and minor version increments. This approach implements an Azure DevOps pipeline to facilitate manual version bumps while retaining semantic-release’s benefits.

This setup provides a balance between automation and control, addressing scenarios where versioning needs to align with business cycles or external factors, unlike purely automated systems that rely solely on commit messages. Failing to control versioning can lead to misaligned releases and increased coordination overhead.

Key Insights

  • Semantic-release uses Conventional Commits, 2017: Automates versioning based on commit message structure.
  • Manual overrides offer control: Companies like JetBrains use year-based major versions, requiring manual intervention.
  • Azure DevOps pipelines integrate: Provide a UI for parameter input and approval workflows.

Working Example

parameters:
- name: bumpType
type: string
default: "patch"
values:
- major
- minor
- patch
- name: bumpNumber
type: string
default: "0"
pool:
vmImage: ubuntu-latest
jobs:
- job: approval
pool: server
steps:
- task: ManualValidation@1
condition: ne('${{ parameters.bumpType }}', 'patch')
- job: create_tag
dependsOn: approval
steps:
- script: |
npx semantic-release
displayName: Run semantic-release setting ${{ parameters.bumpType }} version to ${{ parameters.bumpNumber }}
env:
SEMANTIC_RELEASE_BUMP_TYPE: ${{ parameters.bumpType }}
SEMANTIC_RELEASE_BUMP_NUMBER: ${{ parameters.bumpNumber }}
// file release.config.cjs
module.exports = {
plugins: [
['@semantic-release/commit-analyzer', { releaseRules: [
{ release: process.env.SEMANTIC_RELEASE_BUMP_TYPE }
] }],
'./verify-release.js'
]
};
// file verify-release.js
module.exports = {
verifyRelease: async (pluginConfig, context) => {
const { lastRelease = {}, nextRelease = {}, logger = console } = context;
const bumpType = process.env.SEMANTIC_RELEASE_BUMP_TYPE;
const bumpNumber = process.env.SEMANTIC_RELEASE_BUMP_NUMBER;
// ... (rest of the code)
}
}

Practical Applications

  • Software Vendor: A software company uses this pipeline to align major releases with annual product cycles.
  • Pitfall: Relying solely on automated versioning without manual overrides can lead to unexpected releases or inability to coordinate with marketing.

References:

Continue reading

Next article

Mastering Database Performance: A Deep Dive into Indexing Strategies

Related Content