Sign inSign up

sinlov/woodpecker-npm

By sinlov

Updated over 1 year ago

npm publish for woodpecker-ci

Image
0

10K+

sinlov/woodpecker-npm repository overview

woodpecker-npm

before use

{
  "publishConfig": {
    "registry": "https://registry.npmjs.org/"
  }
}

Settings

NameRequiredDefault valueDescription
debugnofalseopen debug log or open by env PLUGIN_DEBUG
npm-registrynononeNPM registry settings if empty will use https://registry.npmjs.org/
npm-usernameyesnoneNPM username
npm-passwordyesnoneNPM password
npm-tokenyesnoneNPM token to use when publishing packages. if token is set, username and password will be ignored.
npm-emailyesnoneNPM email
npm-foldernononefolder containing package.json, empty will use workspace
npm-dry-runnofalseNPM dry run mode, will not publish to NPM registry (v1.1+)
npm-tagnononeNPM publish option to avoid tag being marked as latest, commonly used are beta, alpha, experimental, etc.
npm-force-tagnofalseNPM enable this will check the prefix of the prerelase version by semver, when tag name not latest or next, open this will force publish.
npm-accessnononeNPM scoped package access

custom settings

NameRequiredDefault valueDescription
npm-fail-on-version-conflictnofalsefail NPM publish if version already exists in NPM registry
npm-skip-verify-sslnofalsedisables ssl verification when communicating with the NPM registry.
npm-skip-whoaminofalseSkip npm whoami check
npm-rc-user-home-enablenofalseenable .npmrc file write user home, default .npmrc file will write in npm-folder (version v1.1+)

Hide Settings:

NameRequiredDefault valueDescription
timeout_secondno10command timeout setting by second
woodpecker-kit-steps-transfer-file-pathno.woodpecker_kit.steps.transferSteps transfer file path, default by wd_steps_transfer.DefaultKitStepsFileName
woodpecker-kit-steps-transfer-disable-outnofalseSteps transfer write disable out

Example

  • workflow with backend docker

docker hub version semver docker hub image size docker hub image pulls

labels:
  backend: docker
steps:
  woodpecker-npm:
    image: sinlov/woodpecker-npm:latest
    pull: false
    settings:
      # debug: true
      ## registry settings if empty will use https://registry.npmjs.org/
      # npm-registry: https://verdaccio.foo.com
      npm-username: # NPM username
        from_secret: npm_publish_username
      npm-password: # NPM password
        from_secret: npm_publish_password
      npm-email: # NPM email
        from_secret: npm_publish_email
      # npm-dry-run: true # dry run mode, will not publish to NPM registry
      # npm-folder: . # folder containing package.json, empty will use workspace
      # npm-tag: alpha # NPM publish option to avoid tag being marked as latest, commonly used are beta, alpha, experimental, etc. do not use latest, next
      ## fail NPM publish if version already exists in NPM registry, most use in tag publish
      # npm-fail-on-version-conflict: true
  • workflow with backend local, must install at local and effective at evn PATH

GitHub latest SemVer tag) GitHub release)

  • install at ${GOPATH}/bin, latest
go install -a github.com/woodpecker-kit/woodpecker-npm/cmd/woodpecker-npm@latest
  • install at ${GOPATH}/bin, v1.0.0
go install -v github.com/woodpecker-kit/woodpecker-npm/cmd/[email protected]
labels:
  backend: local
steps:
  woodpecker-npm:
    image: woodpecker-npm
    settings:
      # debug: true
      ## registry settings if empty will use https://registry.npmjs.org/
      # npm-registry: https://verdaccio.foo.com
      npm-username: # NPM username
        from_secret: npm_publish_username
      npm-password: # NPM password
        from_secret: npm_publish_password
      npm-email: # NPM email
        from_secret: npm_publish_email
      # npm-dry-run: true # dry run mode, will not publish to NPM registry
      # npm-folder: . # folder containing package.json, empty will use workspace
      # npm-tag: alpha # NPM publish option to avoid tag being marked as latest, commonly used are beta, alpha, next, etc.
      ## fail NPM publish if version already exists in NPM registry, most use in tag publish
      # npm-fail-on-version-conflict: true
settings.debug
  • if open settings.debug will try file browser use override for debug.
full config
labels:
  backend: docker
steps:
  woodpecker-npm:
    image: sinlov/woodpecker-npm:latest
    pull: false
    settings:
      # debug: true
      ## registry settings if empty will use https://registry.npmjs.org/
      # npm-registry: https://verdaccio.foo.com
      ## NPM username
      npm-username:
        from_secret: npm_publish_username
      ## NPM password
      npm-password:
        from_secret: npm_publish_password
      ## NPM token to use when publishing packages. if token is set, username and password will be ignored.
      npm-token:
        from_secret: npm_publish_token
      ## NPM email
      npm-email:
        from_secret: npm_publish_email
      npm-dry-run: true # dry run mode, will not publish to NPM registry
      ## NPM tag to use when publishing packages. this will cover package.json version field.
      npm-tag: alpha # NPM publish option to avoid tag being marked as latest, commonly used are beta, alpha, next, etc.
      npm-force-tag: true # NPM enable this will check the prefix of the prerelase version by semver, when tag name not `latest` or `next`
      ## NPM scoped package access
      npm-access: foo
      ## folder containing package.json, empty will use workspace
      npm-folder: .
      ## fail NPM publish if version already exists in NPM registry
      npm-fail-on-version-conflict: true
      ## disables ssl verification when communicating with the NPM registry.
      npm-skip-verify-ssl: true
      ## Skip npm whoami check
      npm-skip-whoami: true
      ## enable `.npmrc` file write at user home, default .npmrc file will write in `npm-folder`
      npm-rc-user-home-enable: true

Tag summary

Content type

Image

Digest

sha256:5683c74d0

Size

74.5 MB

Last updated

over 1 year ago

docker pull sinlov/woodpecker-npm