1.1.0 • Published 7 months ago

@eclass/semantic-release-surge v1.1.0

Weekly downloads
44
License
MIT
Repository
github
Last release
7 months ago

@eclass/semantic-release-surge

npm build downloads dependencies devDependency Status Test Coverage Maintainability semantic-release

semantic-release plugin to publish a static site with surge.sh

StepDescription
verifyConditionsVerify the presence of the SURGE_TOKEN environment variable and SURGE_ALIAS environment variable or alias option.
prepareBuild assets with a npm script.
publishUpload assets to surge.sh.

Install

npm i -D @eclass/semantic-release-surge

Usage

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

{
  "plugins": [
    "@semantic-release/changelog",
    "@semantic-release/npm",
    "@semantic-release/git",
    "@semantic-release/gitlab",
    "@eclass/semantic-release-surge"
  ]
}

Configuration

Surge authentication

The surge authentication configuration is required and can be set via environment variables.

Environment variables

VariableDescription
SURGE_TOKENSurge token created via surge token
SURGE_ALIASOptional set surge alias. Example my-awesome-project.surge.sh
SURGE_CNAMEOptional set surge custom CNAME. Example my-awesome-project.io

Options

OptionsDescriptionDefault
aliasSet de custom alias to surge.sh project.null
buildScriptNamenpm script to build assets.build
buildIndicate if is requerid build assets.false
asstesIndicate the assets directory.dist

Examples

The build and asstes option can be used to skip the build assets:

{
  "plugins": [
    "@semantic-release/changelog",
    "@semantic-release/npm",
    "@semantic-release/git",
    "@semantic-release/gitlab",
    ["@semantic-release/exec", {
      "publishCmd": "npm run build"
    }],
    ["@eclass/semantic-release-surge", {
      "alias": "my-awesome-project.surge.sh",
      "assets": "build",
      "build": false,
    }]
  ]
}

Is posible specificate a custom npm script build and a custom CNAME:

{
  "plugins": [
    "@semantic-release/changelog",
    "@semantic-release/npm",
    "@semantic-release/git",
    "@semantic-release/gitlab",
    ["@eclass/semantic-release-surge", {
      "alias": "my-awesome-project.surge.sh",
      "cname": "my-awesome-project.io",
      "buildScriptName": "build:client"
    }]
  ]
}
{
  "scripts": {
    "build:client": "react-scripts build"
  }
}

License

MIT

1.1.0

7 months ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago