Skip to content

pragmaticindustries/calver-release-action

 
 

Repository files navigation

CalVer Release Action

CalVer

CalVer is a versioning convention based on your project's release calendar, instead of arbitrary numbers.

Source

Usage

Inputs

  • api_token (REQUIRED): GitHub token to be used for this action
  • dry_run (OPTIONAL): Whether to publish a release or just print supposed version (default: false)
  • generate_release_notes (OPTIONAL): Whether to generate release notes (default: true)
  • timezone (OPTIONAL): Timezone to be used for version generations (default: utc; example: Asia/Tokyo)
  • target_commitish (OPTIONAL): Target commitish to be used for release. The default value is SHA of current workflow context. (example: 78cb8a7/main)
  • release_title (OPTIONAL): Title format for the release. ${version} can be used and replaced as the generated version string. (default: Release ver. ${version}; example: New Release: ${version})

Outputs

  • version: Generated string of new version (currently only YYYY.0M.0D.MINOR is supported)
  • url: GitHub url for the published release
  • title: Generated string of the release title

Example

name: Publish

on:
  workflow_dispatch:
concurrency:
  publish_version
jobs:
  publish:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v3
      - uses: cho0o0/calver-release-action@2022.12.14.1
        with:
          generate_release_notes: true
          dry_run: false
          # Do not use GITHUB_TOKEN if you want to trigger other workflows
          timezone: 'utc'
          api_token: ${{secrets.GITHUB_TOKEN}}
          release_title: '${version}'

Development

First, you'll need to have a reasonably modern version of node handy. This won't work with versions older than 9, for instance.

Install the dependencies

$ npm install

Build the typescript and package it for distribution

$ npm run build && npm run package

Run the tests ✔️

$ npm test

Validate

You can now validate the action by referencing ./ in a workflow in your repo (see test.yml)

uses: ./
with:
  dry_run: true
  api_token: ${{secrets.GITHUB_TOKEN}}

About

GitHub Action to generate CalVer release

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 92.0%
  • Dockerfile 4.9%
  • JavaScript 2.4%
  • Shell 0.7%