All Projects → pascalgn → Npm Publish Action

pascalgn / Npm Publish Action

Licence: mit
GitHub action to automatically publish packages to npm

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Npm Publish Action

Use Force Update
React Hook to force your functional component to update.
Stars: ✭ 142 (-8.39%)
Mutual labels:  npm
Lib React Hooks
General purpose React hooks library ⚛️
Stars: ✭ 145 (-6.45%)
Mutual labels:  npm
Homebridge Wol
A Wake on Lan plugin for Homebridge
Stars: ✭ 150 (-3.23%)
Mutual labels:  npm
Mirai
The core for Mirai Bot v4 [Deprecated]
Stars: ✭ 142 (-8.39%)
Mutual labels:  npm
Klap
zero config, zero dependency bundler for tiny javascript packages
Stars: ✭ 143 (-7.74%)
Mutual labels:  npm
Laravel Nuxt Js
Build a SPA with Laravel and Nuxt.
Stars: ✭ 146 (-5.81%)
Mutual labels:  npm
Book
《现代化前端工程师权威指南》https://guoyongfeng.github.io/book/
Stars: ✭ 141 (-9.03%)
Mutual labels:  npm
Tbify
使用淘宝镜像运行命令: tbify [nvm|npm|npx|yarn|pnpm|...]
Stars: ✭ 153 (-1.29%)
Mutual labels:  npm
React Native Story
React native instagram story
Stars: ✭ 144 (-7.1%)
Mutual labels:  npm
Form Storage
A JavaScript library stores the form-data to the localstorage so you don't have to fill the form again.
Stars: ✭ 150 (-3.23%)
Mutual labels:  npm
Node Docker Good Defaults
sample node app for Docker examples
Stars: ✭ 1,944 (+1154.19%)
Mutual labels:  npm
Npm Publish
GitHub Action to publish to NPM
Stars: ✭ 141 (-9.03%)
Mutual labels:  npm
Angular Tree Dnd
Display tree table (or list) & event Drap & Drop (allow drag multi tree-table include all type: table, ol, ul) by AngularJS
Stars: ✭ 146 (-5.81%)
Mutual labels:  npm
Verdaccio Gitlab
private npm registry (Verdaccio) using gitlab-ce as authentication and authorization provider
Stars: ✭ 142 (-8.39%)
Mutual labels:  npm
Lighthouse Badges
🚦Generate badges (shields.io) based on Lighthouse performance.
Stars: ✭ 150 (-3.23%)
Mutual labels:  npm
Tosin
Initialize a npm package with everything included, from CI to documentation website
Stars: ✭ 142 (-8.39%)
Mutual labels:  npm
Verdaccio
📦🔐 A lightweight Node.js private proxy registry
Stars: ✭ 12,667 (+8072.26%)
Mutual labels:  npm
Goa
基于Beego开发的问答系统
Stars: ✭ 154 (-0.65%)
Mutual labels:  npm
Nodejs
This project provides Scala.js type-safe bindings for Node.js (current) v8.7.0 and LTS v6.11.4 APIs. The platform supports MEAN (MongoDB, Express, AngularJs, NodeJS), Cassandra, MySQL and many other npm projects.
Stars: ✭ 152 (-1.94%)
Mutual labels:  npm
React Border Wrapper
A wrapper for placing elements along div borders.
Stars: ✭ 147 (-5.16%)
Mutual labels:  npm

npm-publish-action

GitHub action to automatically publish packages to npm.

Usage

Create a new .github/workflows/npm-publish.yml file:

name: npm-publish
on:
  push:
    branches:
      - main # Change this to your default branch
jobs:
  npm-publish:
    name: npm-publish
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/[email protected]
    - name: Publish if version has been updated
      uses: pascalgn/[email protected]
      with: # All of theses inputs are optional
        tag_name: "v%s"
        tag_message: "v%s"
        create_tag: "true"
        commit_pattern: "^Release (\\S+)"
        workspace: "."
        publish_command: "yarn"
        publish_args: "--non-interactive"
      env: # More info about the environment variables in the README
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
        NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings

Now, when someone changes the version in package.json to 1.2.3 and pushes a commit with the message Release 1.2.3, the npm-publish action will create a new tag v1.2.3 and publish the package to the npm registry.

Inputs

These inputs are optional: that means that if you don't enter them, default values will be used and it'll work just fine.

  • tag_name: the name pattern of the new tag
  • tag_message: the message pattern of the new tag
  • create_tag: whether to create a git tag or not (defaults to "true")
  • commit_pattern: pattern that the commit message needs to follow
  • workspace: custom workspace directory that contains the package.json file
  • publish_command: custom publish command (defaults to yarn)
  • publish_args: publish command arguments (for example --prod --verbose, defaults to empty)

Environment variables

  • GITHUB_TOKEN: this is a token that GitHub generates automatically, you only need to pass it to the action as in the example
  • NPM_AUTH_TOKEN: this is the token the action will use to authenticate to npm. You need to generate one in npm, then you can add it to your secrets (settings -> secrets) so that it can be passed to the action. DO NOT put the token directly in your workflow file.

Related projects

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].