Skip to content

Commit

Permalink
👨‍💻CODE BY 🕊️★⃝AJAY O S©️🧚‍♂️
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajayos committed Apr 22, 2023
1 parent f8daee3 commit 78ad583
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/npm-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- name: Publish to GitHub npm registry
uses: actions/github-script@v4.2.0
env:
NPM_AUTH_TOKEN: ${{ secrets.TOKEN }}
with:
script: |
const { spawnSync } = require('child_process');
const packagePath = './package.json';
const packageName = require(`${packagePath}/package.json`).name;
const version = require(`${packagePath}/package.json`).version;
const command = `npm publish --registry=https://npm.pkg.github.com --access public`;
const result = spawnSync(command, {
shell: true,
env: {
...process.env,
NPM_CONFIG_REGISTRY: 'https://registry.npmjs.org/',
NPM_TOKEN: process.env.NPM_AUTH_TOKEN,
},
cwd: packagePath,
});
if (result.status !== 0) {
throw new Error(`Failed to publish package ${packageName}@${version} to GitHub npm registry`);
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,5 @@ The output format for each message type is as follows:
* Horizontal line (cyan text): `>-----------------------------<`
## License
nodelogger is released under the [`Apache-2.0`](/LICENSE) License.

>>>>>>> f8daee3e25d979267866dae8298bc858ba802427

0 comments on commit 78ad583

Please sign in to comment.