nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.51k stars 2.34k forks source link

cannot publish all nx libraries to github actions registry #11274

Closed nhhockeyplayer closed 1 year ago

nhhockeyplayer commented 2 years ago

SUBJECT: cannot publish all nx libraries to github actions registry

Current Behavior

Hi Team thanks for an elite magnificent product.

I have a repo (ask to collab if you want in) https://github.com/nhhockeyplayer/meanstacknh

All my libs under libs folder are buildable and publishable and I am trying to publish to github actions.

My Nx Monorepo has a directory structure for a particular module libs/admin/root/feature-shell

but during my publish.yml the logic tries to do this and cannot penetrate the lib folders appropriately in order to get thru to the actual library module

            - name: Publish components (Github packages)
              run: |
                  for LIBRARY in $(yarn nx affected:libs --base=$last_version --head=$current_version --plain | awk 'NR > 2 && $1 != "Done" { print $1 }')
                  do
                    cd ./dist/libs/$LIBRARY
                    npm publish --registry https://npm.pkg.github.com --no-git-tag-version --no-push --yes
                    cd ..
                    cd ..
                  done

and it gets stuck in the root dir at ./dist/libs/$LIBRARY unable to change to the child directory in order to get to AdminRootFeatureShell.module folder and stuck at top level dir

does Nx have a way to iterate libraries and publish them? I have a dozen + libs to publish

I am not seeing a publish automated feature as part of Nx as of yet is it under development?

any help here is really appreciated

Expected Behavior

just trying to publish my libs

Steps to Reproduce

trigger PR push for CI/CD

Failure Logs

Publish Components
0s
Run for LIBRARY in $(yarn nx affected:libs --base=$last_version --head=$current_version --plain | awk 'NR > 2 && $[1](https://github.com/nhhockeyplayer/meanstacknh/runs/7490557165?check_suite_focus=true#step:10:1) != "Done" { print $1 }')
  for LIBRARY in $(yarn nx affected:libs --base=$last_version --head=$current_version --plain | awk 'NR > [2](https://github.com/nhhockeyplayer/meanstacknh/runs/7490557165?check_suite_focus=true#step:10:2) && $1 != "Done" { print $1 }')
  do
    cd ./dist/libs/$LIBRARY
    npm publish --registry https://npm.pkg.github.com --no-git-tag-version --no-push --yes
    cd ..
    cd ..
  done
  shell: /usr/bin/bash -e {0}
  env:
    current_version: v0.4.0
    last_version: v0.[3](https://github.com/nhhockeyplayer/meanstacknh/runs/7490557165?check_suite_focus=true#step:10:3).0
    GITHUB_TOKEN: ***
/home/runner/work/_temp/52a6a069-70c5-[4](https://github.com/nhhockeyplayer/meanstacknh/runs/7490557165?check_suite_focus=true#step:10:4)1ba-9ce8-ed7dab1d2c[6](https://github.com/nhhockeyplayer/meanstacknh/runs/7490557165?check_suite_focus=true#step:10:6)0.sh: line 3: cd: ./dist/libs/admin-root-feature-shell: No such file or directory
Error: Process completed with exit code 1.

Environment

nx report

 >  NX   Report complete - copy this into the issue template

   Node : 16.15.1
   OS   : darwin x64
   yarn : 1.22.18

   nx : 14.4.3
   @nrwl/angular : 14.4.3
   @nrwl/cypress : 14.4.3
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.4.3
   @nrwl/eslint-plugin-nx : 14.4.3
   @nrwl/express : 14.4.3
   @nrwl/jest : 14.4.3
   @nrwl/js : 14.4.3
   @nrwl/linter : 14.4.3
   @nrwl/nest : 14.4.3
   @nrwl/next : Not Found
   @nrwl/node : 14.4.3
   @nrwl/nx-cloud : 14.2.0
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : 8.12.11
   @nrwl/storybook : 14.4.3
   @nrwl/web : 14.4.3
   @nrwl/workspace : 14.4.3
   typescript : 4.7.4
   ---------------------------------------
   Community plugins:
     @fortawesome/angular-fontawesome: 0.11.1
     @ionic/angular: 6.1.15
     @ngrx/component: 14.0.2
     @ngrx/component-store: 14.0.2
     @ngrx/effects: 14.0.2
     @ngrx/entity: 14.0.2
     @ngrx/router-store: 14.0.2
     @ngrx/store: 14.0.2
     @nxtend/capacitor: 13.0.0
     @nxtend/ionic-angular: 13.1.0
     @storybook/angular: 6.5.9
     angular-builder-custom-terser-options: 1.0.1
     @compodoc/compodoc: 1.1.19
     @ngrx/schematics: 14.0.2
     @ngrx/store-devtools: 14.0.2
     ngx-build-plus: 14.0.0
github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.