A GitHub Action that creates new releases using Calendar Versioning (CalVer) with the format YYYY.MM.PATCH.
---
name: Release
on:
# Manually trigger a new release from the Actions tab
workflow_dispatch:
inputs:
dry-run:
description: Dry Run
default: false
required: false
type: boolean
draft:
description: Draft Release
default: false
required: false
type: boolean
# Dry run on any PR to the main branch to make sure the workflow would run
# successfully before merging
pull_request:
branches: ['main']
# Automatically create releases on every push to the main branch
push:
branches: ['main']
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: '${{ secrets.GITHUB_TOKEN }}'
- name: Create Release
uses: mirceanton/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
dry-run: ${{ (inputs.dry-run || github.event_name == 'pull_request') }}
draft: ${{ inputs.draft }}| Input | Description | Required | Default |
|---|---|---|---|
github-token |
GitHub token with repository access | Yes | N/A |
dry-run |
Perform a dry run without creating an actual release | No | false |
draft |
Create release as a draft (unpublished). | No | false |
| Output | Description |
|---|---|
release-tag |
The generated release tag (e.g., 2025.4.0) |
previous-tag |
The previous release tag that was used as reference |
release-url |
URL to the created GitHub release |
- Retrieves the previous release tag using GitHub CLI
- Extracts the year, month, and patch components from the previous tag
- Compares with the current date to determine if a new month has started
- Generates the new release tag:
- For the same month: increments patch number by 1
- For a new month: resets patch number to 0
- Creates a GitHub release with the new tag and auto-generated notes
- Provides the release URL and tag information as outputs
This action follows - obviously - Calendar Versioning.
MIT