moment-business-days icon indicating copy to clipboard operation
moment-business-days copied to clipboard

Release for NPM

Open GaborTorma opened this issue 3 years ago • 8 comments

Please create a new release for NPM with forcedBusinessDays support. NPM has an old, 2 years version. Thanx!

GaborTorma avatar Oct 24 '21 04:10 GaborTorma

Please create a new release.

GaborTorma avatar Nov 19 '21 12:11 GaborTorma

@kalmecak if you want I can help you setup GitHub Actions so that when we create a release on here, a new release is published to npm. I've had some experience in this regard so it wouldn't require you much ongoing work if at all.

mcdado avatar Nov 19 '21 13:11 mcdado

It would be nice, how can we do that?

eduolalo avatar Nov 19 '21 16:11 eduolalo

There's an official guide on GitHub: Publishing Node.js packages

I did it for another package that I publish, first you need to add a NPM Token as a Repository secret in the Repository Settings:
Screenshot 2021-11-22 at 11 03 52

Then add an action file. Here's the one from another project of mine:
https://github.com/mcdado/node-helpscout/blob/3ca7f5148428208a2212c25cbea63563142008d6/.github/workflows/publish_on_release.yml

name: publish node package to npm
on:
  release:
    types: [created]
jobs:
  publish_to_npm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      # Setup .npmrc file to publish to npm
      - uses: actions/setup-node@v2
        with:
          node-version: '16'
          registry-url: 'https://registry.npmjs.org'
      - run: npm install
      - run: npm publish --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

When you create a release it will automatically publish a new version to NPM. You have to make sure to bump the version in package.json.

mcdado avatar Nov 22 '21 10:11 mcdado

@kalmecak I just added the Github action. You need to add a repository secret called NPM_TOKEN as explained above.

mcdado avatar Apr 13 '22 12:04 mcdado

It would be great if you release a new version with forced business days feature. Thanks!

elupanov avatar May 12 '22 11:05 elupanov

@kalmecak please, can you provide the NPM token to the project?

mcdado avatar Jul 18 '22 18:07 mcdado

Temporary solution, install directly from git:

npm install --save https://github.com/kalmecak/moment-business-days.git

GaborTorma avatar Jul 23 '22 07:07 GaborTorma

I created a published fork with updated dependecies: https://github.com/GaborTorma/moment-working-days

GaborTorma avatar Oct 09 '22 10:10 GaborTorma

Temporary solution, install directly from git:

npm install --save https://github.com/kalmecak/moment-business-days.git

Or it can be done by doing

npm i https://github.com/kalmecak/moment-business-days.git#git-commit-hash

to install a specific version, rather than default to main/master branch which can introduce breaking changes

GervinFung avatar Nov 09 '22 07:11 GervinFung