Skip to content

Commit

Permalink
dryrun with verdaccio
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 2, 2024
1 parent bac28d4 commit dcd3b4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deprecate_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # version 3.6.0
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/restore_install_cache
# TODO remove proxy before merging -- for testing only
- run: npm run start:npm-proxy
- name: Deprecate release versions
# TODO remove defaults before merging -- for testing only
run: npx tsx scripts/deprecate_release.ts --commit-hash ${{ inputs.commitHash || 'e81b212ab' }} --deprecation-message "${{ inputs.deprecationMessage || 'test deprecation message' }}"
14 changes: 7 additions & 7 deletions scripts/deprecate_release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,19 @@ const prResult = await ghClient.pulls.create({
base: baseBranch,
head: prBranch,
title: `Deprecate release ${commitHash}`,
body: `Restores the contents of the .changeset directory to the previous release commit state ${previousReleaseCommitHash}.`,
body: `Restores the contents of the \`.changeset\` directory to the previous release commit state ${previousReleaseCommitHash}.`,
...ghContext.repo,
});

console.log(`Created rollback PR at ${prResult.data.url}`);
console.log(`Created rollback PR at ${prResult.data.html_url}`);

// setup the .npmrc file using NPM_TOKEN
await fsp.writeFile(
'.npmrc',
// eslint-disable-next-line spellcheck/spell-checker
`//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}${EOL}`
// `//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}${EOL}`
// eslint-disable-next-line spellcheck/spell-checker
`//registry.npmjs.org/:_authToken=garbage${EOL}`
);

console.log(
Expand All @@ -209,14 +211,12 @@ for (const packageVersion of packageVersionsToRestore) {
console.log(
`Restoring dist tag "${distTag}" to package version ${packageVersion}`
);
// TODO uncomment but testing in "dry-run" mode for now
// await $(inheritIO)`npm dist-tag add ${packageVersion} ${distTag}`;
await $(inheritIO)`npm dist-tag add ${packageVersion} ${distTag}`;
console.log(`Done!${EOL}`);
}

for (const packageVersion of packageVersionsToDeprecate) {
console.log(`Deprecating package version ${packageVersion}`);
// TODO uncomment but testing in "dry-run" mode for now
// await $(inheritIO)`npm deprecate ${packageVersion} "${deprecationMessage}"`;
await $(inheritIO)`npm deprecate ${packageVersion} "${deprecationMessage}"`;
console.log(`Done!${EOL}`);
}

0 comments on commit dcd3b4e

Please sign in to comment.