semantic-release-vercel
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

semantic-release-vercel

semantic-release plugin to publish a vercel project using vercel/client.

Step Description
verifyConditions Verify the presence of the VERCEL_TOKEN and VERCEL_TEAM_ID environment variables
publish Publish the project to vercel.

Install

with npm:

npm install --save-dev semantic-release-vercel

with pnpm:

pnpm add -D semantic-release-vercel

with yarn:

yarn add --dev semantic-release-vercel

with bun:

bun add -d semantic-release-vercel

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "semantic-release-vercel",
  ]
}

Configuration

Vercel authentication

The Vercel token is required and can be set via environment variables or options.

Environment variables

Variable Description
VERCEL_TOKEN Vercel token created via Vercel site
VERCEL_TEAM_ID Vercel team id obtained via Vercel site

Options

A plugin configuration can be specified by wrapping the name and an options object in an array. Options configured this way will be passed only to that specific plugin.

Option Type Description Default
channels ChannelConfiguration[] Array of channel configurations defining deployment behavior for different release channels. Channels Default Configuration
globalOptions Vercel Global Options Global settings applying to all deployments, including Vercel client and deployment options. undefined

Channel configuration

Channel extends DeploymentOptions from @vercel/client, omitting the version, autoAssignCustomDomains, and gitMetadata fields. By default, each channel inherits its deployment configurations from the Vercel Global Options, ensuring a consistent setup across all deployments. However, individual channels can override these inherited settings, allowing for customized deployment behaviors specific to each distribution channel.

Option Type Description Default
channel string/false/undefined The Semantic Release distribution channel to deploy to. If false, deploys to production. Branch name

if no channels are provided in Options, the Channels Default Configuration is applied:

[
    {
      channel: false,
      target: "production", // vercel production deploy
    },
    {
      channel: "next",
      target: "preview", // vercel preview deploy
    },
    {
      channel: "next-major",
      target: "preview", // vercel preview deploy
    },
    {
      channel: "beta",
      target: "beta", // vercel custom beta branch deploy
    },
    {
      channel: "alpha",
      target: "alpha", // vercel custom alpha branch deploy
    },
]

Vercel Global Options

Option Type Description Default
client VercelClientOptions Configuration options for interacting with the Vercel API. undefined
deployment DeploymentOptions Settings for customizing the deployment process. undefined

npm configuration

The plugin uses the vercel client which will read the configuration from vercel.json.

Examples

Simple

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "semantic-release-vercel"
    ]
  ]
}

Custom Channels

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "semantic-release-vercel",
      {
        "channels": [
            {
                "channel": false,
                "target": "production",
            },
            {
                "channel": "develop",
                "target": "preview",
            }
        ]
      }
    ],
  ]
}

Custom Project Setting

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "semantic-release-vercel",
      {
        "globalOptions": {
            "deployment": {
                "projectSettings": {
                    "framework": "angular",
                    "devCommand": "pnpm ng serve",
                    "installCommand": "pnpm i",
                    "buildCommand": "pnpm build",
                    "outputDirectory": "dist"
                }
            }
        }
      }
    ],
  ]
}

Package Sidebar

Install

npm i semantic-release-vercel

Weekly Downloads

0

Version

1.2.2

License

MIT

Unpacked Size

70.6 kB

Total Files

88

Last publish

Collaborators

  • kernelpanic92