11import path from 'path' ;
22import * as url from 'url' ;
3- import { getOtp } from '@continuous-auth/client' ;
43import { $ } from 'execa' ;
54import fs from 'fs-extra' ;
65import { inc } from 'semver' ;
76
87const RELEASE_TAG = process . env . TAG || 'beta' ;
98const RELEASE_DRY_RUN = process . env . DRY_RUN || 'true' ;
109const RELEASE_VERSION_TYPE = process . env . VERSION || 'prerelease' ;
11- const RELEASE_NPM_TOKEN = process . env . NPM_TOKEN || '' ;
1210
1311const __dirname = url . fileURLToPath ( new URL ( '.' , import . meta. url ) ) ;
1412const PKG_PATH = path . resolve ( __dirname , '../package.json' ) ;
@@ -28,29 +26,16 @@ console.info(`Updating version from ${currentVersion} to ${nextVersion}`);
2826pkg . version = nextVersion ;
2927fs . writeJsonSync ( PKG_PATH , pkg , { spaces : 2 } ) ;
3028
31- // Write npmrc
32- const npmrcPath = `${ process . env . HOME } /.npmrc` ;
33- console . info ( `Writing npmrc to ${ npmrcPath } ` ) ;
34- fs . writeFileSync (
35- npmrcPath ,
36- `//registry.npmjs.org/:_authToken=${ RELEASE_NPM_TOKEN } ` ,
37- ) ;
38-
3929// Publish to npm
4030console . info ( `Publishing to npm with tag ${ RELEASE_TAG } ` ) ;
4131const dryRun = RELEASE_DRY_RUN === 'true' ? [ '--dry-run' ] : [ ] ;
42- console . log ( 'Getting OTP code' ) ;
43- let otp = await getOtp ( ) ;
44- console . log ( 'OTP code get, continuing...' ) ;
4532
4633try {
47- await $ `pnpm publish ${ dryRun } --tag ${ RELEASE_TAG } --otp ${ otp } -- no-git-checks --provenance ` ;
34+ await $ `pnpm publish ${ dryRun } --tag ${ RELEASE_TAG } --no-git-checks` ;
4835 console . info ( `Published successfully` ) ;
4936} catch ( e ) {
5037 console . error ( `Publish failed: ${ e . message } ` ) ;
5138 process . exit ( 1 ) ;
52- } finally {
53- fs . removeSync ( npmrcPath ) ;
5439}
5540
5641// Push tag to github
0 commit comments