GitHub Action: Semantic Release

September 4, 2022 · View on GitHub

semantic-release as a GitHub Action, with all presets included

license release semantic

semantic-release as a GitHub Action, with all presets included.

Usage

on:
  push:
    branches: [ master ]

jobs:
  release:
    runs-on: ubuntu-latest

    steps:
      - name: checkout
        uses: actions/checkout@v2

      - name: semantic-release
        uses: ahmadnassri/action-semantic-release@v2
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Inputs

inputrequireddefaultdescription
configsee docsFile path to configuration file
dryfalseExecute in "dry-run" mode
debugfalseOutput debugging information
formatsee docsThe Git tag format used by semantic-release to identify releases
branchessee docsThe branches on which releases should happen

⚠️ Note: only use config if you're using a non-standard configuration file name and in JSON format

Outputs

outputexampledescription
publishedtrue'true' when release is successfully published, 'false' when nothing is published
last-release-git-headd80709The sha of the last commit being part of the last release
last-release-git-tagv1.0.0The Git tag associated with the last release
last-release-channelnextThe distribution channel on which the last release was initially made available (null for the default distribution channel)
last-release-version1.0.0The version of the last release
last-release-version-major1last release version major component
last-release-version-minor0last release version minor component
last-release-version-patch0last release version patch component
last-release-version-prerelease-last release version prerelease component
last-release-version-buildmetadata-last release version buildmetadata component
release-typemajorThe semver type of the release (patch, minor or major)
release-git-headd494d2The sha of the last commit being part of the new release
release-git-tagv1.1.0The Git tag associated with the new release
release-version1.1.0The version of the new release.
release-notes...The release notes for the new release
release-channelnextThe distribution channel on which the next release will be made available (null for the default distribution channel)
release-version-major1last release version major component
release-version-minor1last release version minor component
release-version-patch0last release version patch component
release-version-prerelease-last release version prerelease component
release-version-buildmetadata-last release version buildmetadata component

Author: Ahmad Nassri • Twitter: @AhmadNassri