1. @eclass/semantic-release-surge
semantic-release plugin to publish a static site with surge.sh
@eclass/semantic-release-surge
Package: @eclass/semantic-release-surge
Created by: eclass
Last modified: Fri, 06 Oct 2023 18:23:56 GMT
Version: 1.1.0
License: MIT
Downloads: 95
Repository: https://github.com/eclass/semantic-release-surge

Install

npm install @eclass/semantic-release-surge
yarn add @eclass/semantic-release-surge

@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

Step Description
verifyConditions Verify the presence of the SURGE_TOKEN environment variable and SURGE_ALIAS environment variable or alias option.
prepare Build assets with a npm script.
publish Upload 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

Variable Description
SURGE_TOKEN Surge token created via surge token
SURGE_ALIAS Optional set surge alias. Example my-awesome-project.surge.sh
SURGE_CNAME Optional set surge custom CNAME. Example my-awesome-project.io

Options

Options Description Default
alias Set de custom alias to surge.sh project. null
buildScriptName npm script to build assets. build
build Indicate if is requerid build assets. false
asstes Indicate 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

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code