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.
Continuous integration is provided by .github/workflows/ci.yml
.
CI runs Rust tests on an ubuntu-latest
runner.
---
name: CI
on:
pull_request:
jobs:
test:
uses: semantic-release-action/typescript/.github/workflows/ci.yml@v3
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 |
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.
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.
Runtime flag to control execution of post-install scripts.
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
This workflow currently only supports single-package repositories. Monorepo support has not been considered.
---
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 }}
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 |
Singular Node.js version on which to invoke semantic-release.
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.
Secret | Required | Description |
---|---|---|
npm-token | true | npm registry API token. Details |
API token with write permission for publishing your package to your target registry.