2

We have a monorepo that we are using Lerna to publish to a private package manager (nexus). When the action runs, it fails with same vague message:

info cli using local version of lerna
lerna notice cli v5.3.0
lerna info ci enabled
Error: Process completed with exit code 1.

This message occurs after github actions tries to run the lerna publish command.

I've tried dozens of variations of installing Lerna globally and locally as well as all sort of variations of flags on my lerna bootstrap and lerna publish commands. I am not sure what to try. Any insights would be appreciated. Below is my worklflow file.

Node: 16.15.1 Lerna: 5.3.0

release.yml

name: 'MyPackage Production Release'

on:
  workflow_dispatch:
    inputs:
      version:
        required: true
        type: choice
        description: Which version should be published?
        options:
          - patch
          - minor
          - major
      tag:
        required: true
        type: choice
        description: Which npm tag should this be published to?
        options:
          - latest
          - next
          - test

jobs:
  build-my-package:
    runs-on: [self-hosted, Linux, X64, enterprise]
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0 #indicates all history for all branches and tags.
      - uses: actions/setup-node@v3
        with:
          node-version: 16.15.1
          registry-url: 'https://registry.npmjs.org'
      - name: Configure Identity
        run: |
          git config user.name github-actions
          git config user.email github-actions@github.com
        shell: bash
      - name: strict SSL
        run: |
          npm config set cafile my-file.pem
          npm config set strict-ssl false
          npm config set https-proxy http://proxy.our.proxysite.net:80/
          npm config set proxy http://proxy.our.proxysite.net:80/
          npm config set NODE_TLS_REJECT_UNAUTHORIZED=0
          npm config set registry https://registry.npmjs.org/
      - name: Install Dependencies
        run: |
          npm ci --no-package-lock --legacy-peer-deps
          lerna bootstrap --ignore-scripts -- --legacy-peer-deps
        shell: bash
      - name: Prepare Nexus Token
        run: |
          npm config set registry https://nexus.our.site.net/repository/my-package-repo/
          npm config set email myemail@myemail.net
          npm config set strictSSL false
          npm config set alwaysAuth true
          echo //nexus.our.site.net/repository/my-package-repo/:_auth=${{ secrets.NEXUS_BASE64_AUTH }} > .npmrc
          npm config set _auth ${{ secrets.NEXUS_BASE64_AUTH }}
        shell: bash
      - name: Release
        run: |
          HUSKY_SKIP_HOOKS=1 lerna publish $(echo "${{ github.event.inputs.version }}") --yes --force-publish='*' --dist-tag $(echo "${{ github.event.inputs.tag }}") --conventional-commits --create-release github
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
          GHE_API_URL: ${{ secrets.GHE_API_URL }}
          GHE_VERSION: ${{ secrets.GHE_VERSION }}
        shell: bash

0 Answers0