Skip to content

Commit

Permalink
revert(pie-monorepo): DSW-1540 revert extraction of create and publis…
Browse files Browse the repository at this point in the history
…h snapshot step (#1129)

Revert "chore(pie-monorepo): DSW-1540 extract create and publish snapshot step into its own JS file (#1124)"

This reverts commit 03e9d54.
  • Loading branch information
ashleynolan authored Dec 22, 2023
1 parent 5541a6b commit 077747d
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 233 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/changeset-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,45 @@ jobs:
github-token: ${{ secrets.CHANGESETS_TOKEN }}
script: |
const execa = require('execa');
const script = require('./changeset-snapshot/create-and-publish.js')
await script({ github, context }, execa);
await execa.command('yarn changeset:version --snapshot snapshot-release', { stdio: 'inherit' });
const releaseProcess = execa.command('yarn changeset:publish --no-git-tags --snapshot --tag snapshot-release');
releaseProcess.stdout.pipe(process.stdout);
const { stdout } = await releaseProcess;
const newTags = Array
.from(stdout.matchAll(/New tag:\s+([^\s\n]+)/g))
.map(([_, tag]) => tag)
.filter((tag) => !/^wc-.+$|pie-(monorepo|docs|storybook)/.test(tag));
let body;
if (newTags.length > 0) {
const multiple = newTags.length > 1;
body = (
`🫰✨ **Thanks @${context.actor}! ` +
`Your snapshot${multiple ? 's have' : ' has'} been published to npm.**\n\n` +
`Test the snapshot${multiple ? 's' : ''} by updating your \`package.json\` ` +
`with the newly published version${multiple ? 's' : ''}:\n` +
newTags.map(tag => (
'```sh\n' +
`yarn add ${tag}\n` +
'```'
)).join('\n')
);
} else {
body = `No changed packages found! Please make sure you have added a changeset entry for the packages you would like to snapshot.`;
}
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body,
});
- name: Add failure comment
if: failure()
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/changeset-snapshot/create-and-publish.js

This file was deleted.

This file was deleted.

146 changes: 0 additions & 146 deletions .github/workflows/changeset-snapshot/test/create-and-publish.spec.js

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@
"postinstall": "husky install",
"prepack": "pinst --disable",
"postpack": "pinst --enable",
"test": "yarn test:workflows && cross-env-shell turbo run test --filter=!pie-monorepo --token=${TURBO_TOKEN}",
"test:workflows": "cross-env-shell vitest run .github/workflows",
"test": "cross-env-shell turbo run test --filter=!pie-monorepo --token=${TURBO_TOKEN}",
"test:watch": "cross-env-shell turbo run test:watch --filter=!pie-monorepo",
"test:ci": "yarn test:workflows && cross-env-shell turbo run test:ci --filter=!'./apps/examples/*' --filter=!pie-monorepo --token=${TURBO_TOKEN}",
"test:ci": "cross-env-shell turbo run test:ci --filter=!'./apps/examples/*' --filter=!pie-monorepo --token=${TURBO_TOKEN}",
"test:coverage": "turbo run test:coverage --filter=!pie-monorepo",
"test:generate-routes": "turbo run test:generate-routes --filter=!pie-monorepo --token=${TURBO_TOKEN}",
"test:browsers": "cross-env-shell turbo run test:browsers --filter=!pie-monorepo --token=${TURBO_TOKEN}",
Expand Down

0 comments on commit 077747d

Please sign in to comment.