Skip to content

Publish JS

Publish JS #19

Workflow file for this run

name: Publish JS
on:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
if: startsWith(github.event.release.name, '[enochian-js]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: "package.json"
- name: Create .npmrc
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "always-auth=true" >> .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: |
pnpm install
- name: Build package
env:
SGL_IP: ${{ secrets.SGL_IP }}
SGL_PORT: ${{ secrets.SGL_PORT }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
pushd js
pnpm run ci
- name: Publish to NPM
run: |
pushd js
pnpm publish --no-git-checks