File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : npm publish (dry run)
1+ name : npm publish
22
33# Packages are intentionally not published by this workflow yet. Once the
44# generated package contents have been verified, remove --dry-run from the
7373 env :
7474 # npm checks authentication even for a publish dry run.
7575 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
76+
77+ - name : Publish npm packages
78+ shell : bash
79+ run : |
80+ set -euo pipefail
81+
82+ mapfile -t packages < <(
83+ npm query .workspace --json | node -e '
84+ let input = "";
85+ process.stdin.on("data", chunk => input += chunk);
86+ process.stdin.on("end", () => {
87+ for (const workspace of JSON.parse(input)) {
88+ if (!workspace.private) console.log(workspace.name);
89+ }
90+ });
91+ '
92+ )
93+
94+ for package in "${packages[@]}"; do
95+ echo "::group::${package}"
96+ npm publish --workspace "${package}" --access public
97+ echo "::endgroup::"
98+ done
99+ env :
100+ # npm checks authentication even for a publish.
101+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments