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. |
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
The plugin can be configured in the semantic-release configuration file:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"semantic-release-vercel",
]
}
The Vercel token is required and can be set via environment variables or options.
Variable | Description |
---|---|
VERCEL_TOKEN |
Vercel token created via Vercel site |
VERCEL_TEAM_ID |
Vercel team id obtained via Vercel site |
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 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
},
]
Option | Type | Description | Default |
---|---|---|---|
client | VercelClientOptions | Configuration options for interacting with the Vercel API. | undefined |
deployment | DeploymentOptions | Settings for customizing the deployment process. | undefined |
The plugin uses the vercel
client which will read the configuration from vercel.json
.
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"semantic-release-vercel"
]
]
}
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"semantic-release-vercel",
{
"channels": [
{
"channel": false,
"target": "production",
},
{
"channel": "develop",
"target": "preview",
}
]
}
],
]
}
{
"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"
}
}
}
}
],
]
}