Skip to content

Commit 0f97810

Browse files
xiaojunwengnetweng
authored andcommitted
ci: keep lerna publish for trusted publishing
1 parent 31ef59c commit 0f97810

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,7 @@ jobs:
8484
timeout_minutes: 10 # 设置超时时间,单位为分钟
8585
max_attempts: 3 # 设置最大重试次数
8686
command: |
87-
set -eu
88-
./node_modules/.bin/lerna list --toposort --json --loglevel silent > /tmp/publish-packages.json
89-
node -e '
90-
const fs = require("fs");
91-
const packages = JSON.parse(fs.readFileSync("/tmp/publish-packages.json", "utf8"));
92-
for (const pkg of packages) {
93-
const manifest = require(`${process.cwd()}/${pkg.location}/package.json`);
94-
if (manifest.private) continue;
95-
console.log(`${pkg.location}\t${manifest.name}\t${manifest.version}`);
96-
}
97-
' > /tmp/publish-list.tsv
98-
while IFS="$(printf '\t')" read -r location name version; do
99-
if npm view "${name}@${version}" version >/dev/null 2>&1; then
100-
echo "Skip ${name}@${version}: already published"
101-
else
102-
echo "Publish ${name}@${version}"
103-
npm publish "${location}" --access public
104-
fi
105-
done < /tmp/publish-list.tsv
87+
yarn lerna publish from-package --no-verify-access --yes
10688
- name: Get Output
10789
if: steps.tag_check.outputs.exists_tag == 'false'
10890
uses: dawidd6/action-download-artifact@v6

0 commit comments

Comments
 (0)