Skip to content

Commit

Permalink
Trigger changeset for next release (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardlyhel authored Aug 9, 2023
1 parent 72c2f6d commit 02cde56
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/next-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
git checkout -B next/${{ steps.version.outputs.NEXT_VERSION }}
# using changeset snapshot releases, this sets the version to 0.0.0-{tag}-DATETIMESTAMP where tag=next-SHORT_SHA
# as an example this results in a next release as following 0.0.0-next-1686a75-20230313113149 with a next tag
npm run version:next
npm run changeset -- version --snapshot ${{steps.version.outputs.NEXT_VERSION}}
npm run version:post
env:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"version:post": "npm run version:hydrogen && npm run version:cli",
"version:hydrogen": "node -p \"'export const LIB_VERSION = \\'' + require('./packages/hydrogen/package.json').version + '\\';'\" > packages/hydrogen/src/version.ts",
"version:cli": "cd packages/cli && npm run generate:manifest",
"version:next": "node scripts/changeset-version-next.mjs",
"changeset": "changeset",
"clean-all": "rimraf node_modules/.bin && rimraf node_modules/.cache && rimraf packages/*/dist && rimraf templates/*/.cache",
"check": "npm run build && npm run lint && npm run typecheck && npm run test"
Expand Down
23 changes: 23 additions & 0 deletions scripts/changeset-version-next.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import path from 'path';
import fs from 'fs';
import {fileURLToPath} from 'url';

const CHANGESET_ALL = `---
'@shopify/hydrogen-react': patch
'demo-store': patch
'@shopify/hydrogen': patch
'@shopify/cli-hydrogen': patch
'@shopify/create-hydrogen': patch
'@shopify/hydrogen-codegen': patch
'@shopify/remix-oxygen': patch
---
Trigger changeset for all packages for next release
`;

(async () => {
const root = fileURLToPath(new URL('..', import.meta.url));
const changesetPath = path.resolve(root, '.changeset', 'trigger-patch-for-next-release.md');

await fs.writeFile(changesetPath, CHANGESET_ALL, () => {});
})();

0 comments on commit 02cde56

Please sign in to comment.