Skip to content

semantic-release-action/typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

semantic-release-action/typescript

Build Status

This repository contains extremely opinionated reusable GitHub Actions workflows providing CI and CD for TypeScript projects.

This GitHub Action is intended to reduce duplication among very rigidly organized projects. These are not general-purpose workflows. You may find that they work for you and your development workflows out of the box, or they may not.

Continuous deployments brought to you by semantic-release.

CI

Continuous integration is provided by .github/workflows/ci.yml.

CI runs Rust tests on an ubuntu-latest runner.

Use

---
name: CI

on:
  pull_request:

jobs:
  test:
    uses: semantic-release-action/typescript/.github/workflows/ci.yml@v3

Inputs

Input Parameter Default Description
node-versions '["lts/-2", "lts/-1", "lts/*"]' Node.js versions to use for testing. Details
test-command npm run --if-present test Shell command used to provide confidence in proposed changes. Details
allow-postinstall-scripts false If false, uses --ignore-scripts with npm ci. Details

node-versions

The matrix of Node.js versions on which to run tests. Due to limitations of GitHub Actions, this must be expressed as a stringified JSON array.

See here for supported version syntax.

test-command

The shell command used to provide confidence in the proposed changes. Defaults to npm run --if-present test, but you can override this to any shell command.

allow-postinstall-scripts

Runtime flag to control execution of post-install scripts.

Release

Continuous deployments for TypeScript packages are provided by .github/workflows/release.yml.

Each deploy:

  • publishes your package

    The target registry is configured in your package manifest.

  • updates a CHANGELOG.md in your git repository

Limitations

This workflow currently only supports single-package repositories. Monorepo support has not been considered.

Use

---
name: Release

on:
  push:
    branches:
      - master
      - next
      - next-major
      - beta
      - alpha
      - "[0-9]+.[0-9]+.x"
      - "[0-9]+.x"

jobs:
  release:
    uses: semantic-release-action/typescript/.github/workflows/release.yml@v3
    secrets:
      npm-token: ${{ secrets.NPM_TOKEN }}

Inputs

Input Parameter Default Description
test-node-versions '["lts/-2", "lts/-1", "lts/*"]' Node.js versions to use for testing. Details
test-command npm run --if-present test Shell command used to provide confidence in proposed changes. Details
release-node-version lts/* Node.js version to use for releasing. Details
allow-postinstall-scripts false If false, uses --ignore-scripts with npm ci. Details
disable-semantic-release-git false Disable @semantic-release/git in your release flow. Details

release-node-version

Singular Node.js version on which to invoke semantic-release.

disable-semantic-release-git

Runtime option controlling the use of @semantic-release/git. Set to true to prevent semantic-release from pushing artifacts to your repository. This may be required with certain repository settings, for example when requiring signed commits.

Secrets

Secret Required Description
npm-token true npm registry API token. Details

npm-token

API token with write permission for publishing your package to your target registry.