npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

semantic-release-ado

v1.4.0

Published

Semantic release plugin for automatic releases on Azure DevOps pipelines.

Downloads

48,359

Readme

semantic-release-ado

semantic-release Build Status

Semantic release plugin for automatic builds on Azure DevOps pipelines.

| Step | Description | |------------------|-------------| | analyzeCommits | If configured to do so, stores the current version as an Azure DevOps pipeline variable. | | verifyRelease | Stores the next version as an Azure DevOps pipeline variable availabe to downstream steps on the job. |

Install

$ npm install -D semantic-release-ado

Usage

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

YAML:

plugins:
  - @semantic-release-ado"

JSON:

{
  "plugins": [
    "semantic-release-ado",
  ]
}

The generated version number will be stored on a variable availabe to downstream steps on the job. By default this variable is named nextRelease, but the name can be configured in the plugin options. The behavior when no new release is available can be configured with setOnlyOnRelease.

Configuration

Options

| Options | Desctiption | |------------------|-------------------------------------------------------| | varName | Name of the variable that will store the next version. Defaults to nextRelease. | | setOnlyOnRelease | Bool. Determines if the variable with the new version will be set only when a new version is available. If set to false, the next version variable will store the last released version when no new version is available. Defaults to true. | | isOutput | Bool. Determines whether the version will be set as an output variable, so it is available in later stages. Defaults to false. |

The following examples store the generated version number in a variable named version.

YAML:

plugins:
  - - "semantic-release-ado"
    - varName: "version"
      setOnlyOnRelease: true
      isOutput: true #defaults to false

JSON:

{
  "plugins": [
    ["semantic-release-ado", {
      "varName": "version",
      "setOnlyOnRelease": true,
      "isOutput": true //defaults to false
    }],
  ]
}

Azure DevOps build pipeline YAML example:

Using the variable on the seme job:

jobs:
- job: Build
  pool:
    vmImage: 'vs2017-win2016'
  steps:

  - script: >
      npx -p semantic-release
      -p @semantic-release/git
      -p semantic-release-ado
      semantic-release
    env: { GH_TOKEN: $(GitHubToken) }
    displayName: 'Semantic release'

  - script: echo $(nextRelease)
    displayName: 'Show next version'

Using the variable on a later job:

Configuration:

Below is the configuration for setting isOutput to true, which will allow the variable to be referenced from other jobs/stages

JSON:

{
  "plugins": [
    ["semantic-release-ado", {
      "varName": "version",
      "setOnlyOnRelease": true,
      "isOutput": true //sets version as output for later use
    }],
  ]
}

In another job:

jobs:
- job: Job1
  pool:
    vmImage: 'vs2017-win2016'

  steps:
  - script: >
      npx -p semantic-release
      -p @semantic-release/git
      -p semantic-release-ado
      semantic-release
    env: { GH_TOKEN: $(GitHubToken) }
    displayName: 'Semantic release'

- job: Job2
  dependsOn: Job1
  pool:
    vmImage: 'vs2017-win2016'
  variables:
    versionNumber: $[ dependencies.Job1.outputs['setOutputVar.versionNumber'] ]

  steps:
  - script: echo $(versionNumber)
    displayName: 'Show next version'

In another stage:

stages: 
  - stage: Stage1
    jobs:
    - job: Job1
      pool:
        vmImage: 'vs2017-win2016'

      steps:
      - script: >
          npx -p semantic-release
          -p @semantic-release/git
          -p semantic-release-ado
          semantic-release
        env: { GH_TOKEN: $(GitHubToken) }
        name: semantic-release
        displayName: 'Semantic release'

  - stage: Stage2
    dependsOn: Stage1
    #want to make sure variable is set before we continue to run the stage
    condition: and(succeeded(), ne(dependencies.Stage1.outputs['Job1.semantic-release.version'], ''))
    jobs:
    - job: Job2
      variables:
          versionNumber: $[ stageDependencies.Stage1.Job1.outputs['semantic-release.version'] ]
      pool:
        vmImage: 'vs2017-win2016'
      variables:
        versionNumber:
      steps:
      - script: echo $(versionNumber)
        displayName: 'Show next version'