Home

Awesome

Release Action

GitHub Action to automatically release packages using lerna or semantic-release.

Publishing on package registries is skipped if there is not any package.json or if its private field is set to true.

Publishing on GitHub registry is skipped if the package name is not scoped with the GitHub owner name.

Publishing on NPM registry is skipped if no NPM token is provided.

Usage

In .github/workflows/release.yml:

on:
  push:
    branches:
    - main

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v1
      with:
        node-version: 14
    - run: yarn
    - run: yarn build
    - uses: plutotcool/release@v1
      with:
        github_token:  ${{ secrets.GITHUB_TOKEN }}
        npm_token: ${{ secrets.NPM_TOKEN }}

Inputs

github_token

string (required)

GitHub Token used to create the release on GitHub and publish on GitHub registry.

npm_token

string (optional)

NPM token with publish permission. If not provided, publishing to npm registry will be skipped.

publish

boolean (optional, default true)

Enable or disable publishing to package registries. When set to false, only releases are created on GitHub.

push

boolean (optional, default true)

Enable or disable pushing changes made by the action.

name

string (optional, default: 'github-actions[bot]')

User name to use when pushing to GitHub.

email

string (optional, default: 'github-actions[bot]@users.noreply.github.com')

Email to use when pushing to GitHub.

message

string (optional, default: 'ci: release')

Commit message to use when bumping package.json.