moment-business-days
moment-business-days copied to clipboard
Release for NPM
Please create a new release for NPM with forcedBusinessDays support. NPM has an old, 2 years version. Thanx!
Please create a new release.
@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.
It would be nice, how can we do that?
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:
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
.
@kalmecak I just added the Github action. You need to add a repository secret called NPM_TOKEN as explained above.
It would be great if you release a new version with forced business days feature. Thanks!
@kalmecak please, can you provide the NPM token to the project?
Temporary solution, install directly from git:
npm install --save https://github.com/kalmecak/moment-business-days.git
I created a published fork with updated dependecies: https://github.com/GaborTorma/moment-working-days
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