Skip to content

Publish Nu Base Pkg to NPM #2

Publish Nu Base Pkg to NPM

Publish Nu Base Pkg to NPM #2

Workflow file for this run

name: Publish Nu Base Pkg to NPM
on:
push:
branches:
- feature/sync-base
workflow_dispatch:
jobs:
publish-npm-base:
name: Publish the base NPM package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set the release version
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- uses: hustcer/setup-nu@v3
with:
version: 0.98.0
- name: Publish the base package
continue-on-error: true
shell: nu {0}
run: nu nu/npm.nu base
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
test-npm-pkg:
needs: publish-npm-base
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
name: Test Nu@npm on x64-${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Test Nu Install from NPM Registry
shell: bash
run: |
export NU_TAG=`jq -r .distTag npm/app/package.json`
echo "Installing Nu@$NU_TAG from npm..."
npm i --location=global "nushell@$NU_TAG" --registry https://registry.npmjs.org
echo 'Nu version info:'; nu -c 'version'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}