@@ -29,7 +29,6 @@ const path = require('path');
29
29
const runCommand = require ( './run-command' ) ;
30
30
31
31
const packagesDirPath = path . resolve ( __dirname , '../packages' ) ;
32
- const npmrcPath = process . env . NPM_CONFIG_USERCONFIG ;
33
32
34
33
async function isPackageVersionPublished ( packageName , version ) {
35
34
return fetch ( `https://registry.npmjs.org/${ encodeURI ( packageName ) } /${ version } ` )
@@ -54,21 +53,6 @@ async function getPackageInfo(packageDir) {
54
53
} ;
55
54
}
56
55
57
- async function setupNpm ( ) {
58
- // For npm publication to work, the NPM token must be stored in the .npmrc file
59
- console . log ( 'Current .npmrc file:\n' , await fs . readFile ( npmrcPath , 'utf8' ) ) ;
60
- if ( process . env . GITHUB_ACTIONS && process . env . NPM_TOKEN ) {
61
- await fs . appendFile (
62
- npmrcPath ,
63
- `\n//registry.npmjs.org/:_authToken=${ process . env . NPM_TOKEN } ` ,
64
- 'utf8' ) ;
65
- }
66
- }
67
-
68
- async function cleanupNpmrc ( ) {
69
- await fs . unlink ( npmrcPath ) ;
70
- }
71
-
72
56
async function publishPackagesIfNeeded ( packageInfo ) {
73
57
const pkgJson = packageInfo . pkg ;
74
58
const isAlreadyPublished = await isPackageVersionPublished ( pkgJson . name , pkgJson . version ) ;
@@ -85,7 +69,6 @@ async function publishPackagesIfNeeded(packageInfo) {
85
69
}
86
70
87
71
( async ( ) => {
88
- await setupNpm ( ) ;
89
72
const packagesDirEntries = await fs . readdir ( packagesDirPath ) ;
90
73
// build a graph of the interdependencies of projects and only publish
91
74
const graph = new graphlib . Graph ( { directed : true , compound : false } ) ;
@@ -130,4 +113,4 @@ async function publishPackagesIfNeeded(packageInfo) {
130
113
}
131
114
} ) ( ) . catch ( ( e ) => {
132
115
throw e ;
133
- } ) . finally ( cleanupNpmrc ) ;
116
+ } ) ;
0 commit comments