Coder Social home page Coder Social logo

npm-publish-action's Introduction

npm-publish-action

This repository contains the definition for a custom GitHub Action that will inspect the current set of tagged releases in the repository, and determine if any of the packages specified in a JSON configuration file's packages property have a version that has not been tagged and released. This action will then create and push a tag for each package that is found. Once this is completed, this action will determine whether each package at the current version is present in the specified NPM registry, and publish any package that is not currently present in that registry.

The action supports publishing Lerna mono-repos and Yarn workspaces.

Usage

With minimum configuration, this action requires a GITHUB_TOKEN environment variable to be present for creating releases, a JSON configuration file containing a packages property, and an NPM authentication token for the public registry.npmjs.org for publishing.

- uses: Vertexvis/npm-publish-action@v1
  env:
    # The GitHub token that will be used to create tags corresponding to this release.
    # By default, the ${{ secrets.GITHUB_TOKEN }} can be used, and tags will show as
    # created by the "GitHub Actions" user.
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  with:
    # The NPM authentication token that the npm cli will be configured to use when publishing.
    # This input is required, and will not be defaulted
    npm-auth-token: ""

    # The url of the NPM registry that the packages in this repository should be published to.
    # Defaults to "registry.npmjs.org"
    npm-registry: ""

    # Boolean string indicating whether this action should perform a "dry run"
    # which will not publish to NPM or push tags to GitHub.
    # Defaults to "false"
    dry-run: ""

Building

Changes to this action are ultimately made in the dist/index.js file, which is consumed by the action.yml action definition. This index file is compiled from the files in src/ by running the yarn build script. This is also configured as a pre-commit hook in the case that this file has not been re-compiled as part of a commit changing the src/ directory.

Once a branch has been created with the changes to dist/index.js, the action can be run by referencing the specific branch in the consuming workflow file. E.g.

- uses: Vertexvis/npm-publish-action@your-branch-name

npm-publish-action's People

Contributors

amvertex avatar danschultz avatar dependabot[bot] avatar echo5-ci avatar jdm717 avatar snyk-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.