Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -41,10 +43,6 @@ jobs:
TAG_NAME: ${{ github.ref_name }}
- run: npm publish --provenance --access public --tag next
if: "github.event.release.prerelease"
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
- run: npm publish --provenance --access public
if: "!github.event.release.prerelease"
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
- run: node ./cli.js --provenance
12 changes: 6 additions & 6 deletions src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const publishCommand: Command<typeof options> = define({
prompts.cancel(
'Failed to read package.json. Please ensure you run this command in the project directory'
);
return;
process.exit(1);
}

let paths: string[];
Expand All @@ -67,7 +67,7 @@ export const publishCommand: Command<typeof options> = define({
'Failed to load files from `files` array in package.json.'
);
prompts.log.message(String(err));
return;
process.exit(1);
}

let tempDir: string | undefined;
Expand All @@ -82,7 +82,7 @@ export const publishCommand: Command<typeof options> = define({

if (sourceMaps.length === 0) {
prompts.cancel('No sourcemap files were found to publish!');
return;
process.exit(1);
}

const successfulSourceMaps: ExtractedSourceMapSuccess[] = [];
Expand Down Expand Up @@ -112,7 +112,7 @@ export const publishCommand: Command<typeof options> = define({
} catch (err) {
prompts.log.error(`${err}`);
prompts.cancel('Failed to update package.json files');
return;
process.exit(1);
}

try {
Expand All @@ -133,7 +133,7 @@ export const publishCommand: Command<typeof options> = define({
} catch (err) {
prompts.log.error(`${err}`);
prompts.cancel('Failed to update sourcemap URLs');
return;
process.exit(1);
}

const npmArgs: string[] = ['publish', '--tag=sourcemaps'];
Expand Down Expand Up @@ -172,7 +172,7 @@ export const publishCommand: Command<typeof options> = define({
log.message(`${err}\n`, {raw: true});
log.error(`Error running npm ${npmArgs.join(' ')}`);
prompts.cancel('Failed to publish');
return;
process.exit(1);
}

prompts.outro(
Expand Down