nrwl/nx

Unable to publish a package

vymarkov opened this issue · 0 comments

Current Behavior

Currently, when using the suggested GitHub Actions pipeline from the official documentation (mine is adjusted to install Node modules via Yarn), the nx-release-publish target does not invoke the build target

the broken pipeline you can find here
lazy-orange/nx-workspace-v20@6a9bef4

Expected Behavior

build target for particular target must be invoked in order to publish a package

GitHub Repo

https://github.com/lazy-orange/nx-workspace-v20/actions/runs/12306040378/job/34346929709

Steps to Reproduce

  1. Create a publishable package using the @nx/node:library generator:
yarn nx generate @nx/node:library --directory=packages/date-time --buildable=true --name=date-time \
--publishable=true --importPath=@lazy-orange/date-time --strict=true --testEnvironment=node --no-interactive
  1. Update the package sources to trigger the nx-release-publish target.

  2. Push the changes to the main branch, which will create a tag and trigger the pipeline to publish the package.

Nx Report

yarn run v1.22.22
$ /Users/administrator/Projects/dayio/nx-workspace-v20/node_modules/.bin/nx report

 NX   Report complete - copy this into the issue template

Node           : 20.18.0
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 1.22.22

nx                 : 20.1.4
@nx/js             : 20.1.4
@nx/jest           : 20.1.4
@nx/eslint         : 20.1.4
@nx/workspace      : 20.1.4
@nx/devkit         : 20.1.4
@nx/esbuild        : 20.1.4
@nx/eslint-plugin  : 20.1.4
@nx/nest           : 20.1.4
@nx/node           : 20.1.4
@nx/web            : 20.1.4
@nx/webpack        : 20.1.4
typescript         : 5.5.4
---------------------------------------
Registered Plugins:
@nx/webpack/plugin
@nx/eslint/plugin
@nx/jest/plugin
---------------------------------------
Community plugins:
ngx-deploy-npm : 8.2.0

✨  Done in 0.75s.

Failure Logs

2024-12-12T22:42:14.6527320Z ##[group]Run npx nx release publish
2024-12-12T22:42:14.6527665Z �[36;1mnpx nx release publish�[0m
2024-12-12T22:42:14.6554611Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2024-12-12T22:42:14.6554935Z env:
2024-12-12T22:42:14.6555167Z   NPM_CONFIG_USERCONFIG: /home/runner/work/_temp/.npmrc
2024-12-12T22:42:14.6555882Z   NODE_AUTH_TOKEN: ***
2024-12-12T22:42:14.6556110Z   NPM_CONFIG_PROVENANCE: true
2024-12-12T22:42:14.6556336Z ##[endgroup]
2024-12-12T22:42:16.4796165Z 
2024-12-12T22:42:16.4797533Z  NX   Running target nx-release-publish for 3 projects and 2 tasks they depend on:
2024-12-12T22:42:16.4798221Z 
2024-12-12T22:42:16.4798467Z - date-time
2024-12-12T22:42:16.4798849Z - bar
2024-12-12T22:42:16.4799951Z - foo
2024-12-12T22:42:16.4800195Z 
2024-12-12T22:42:16.4800587Z 
2024-12-12T22:42:16.4807823Z Nx is configured to use the legacy cache. This cache will be removed in Nx 21. Read more at https://nx.dev/deprecated/legacy-cache.
2024-12-12T22:42:16.7420309Z 
2024-12-12T22:42:16.7423295Z ##[group]❌ > nx run foo:nx-release-publish
2024-12-12T22:42:16.7425437Z 
2024-12-12T22:42:16.7432757Z 
2024-12-12T22:42:16.7434792Z �[0m�[7m�[1m�[31m NX �[39m�[22m�[27m�[0m  �[31mENOENT: no such file or directory, open '/home/runner/work/nx-workspace-v20/nx-workspace-v20/dist/packages/foo/package.json'�[39m
2024-12-12T22:42:16.7436107Z 
2024-12-12T22:42:16.7436408Z Pass --verbose to see the stacktrace.

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response