Skip to content

Publish package to npmjs #20

Publish package to npmjs

Publish package to npmjs #20

Workflow file for this run

name: Publish package to npmjs
on:
release:
types: [published]
jobs:
package:
runs-on: windows-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install node-gyp
run: npm install -g node-gyp
- name: Install dependencies
run: yarn install --ignore-scripts
- name: Build package
run: npm run build
- name: Create .npmrc file
run: |
echo "@internxt:registry=https://npm.pkg.github.com/" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
- name: Publish package to github
run: npm publish --scope=@internxt --access public
- name: Create .npmrc file
run: |
echo "registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
- name: Publish package to npm
run: npm publish --scope=@internxt --access public