diff --git a/.github/workflows/next-release.yml b/.github/workflows/next-release.yml index b6d6ac8194..e10f571363 100644 --- a/.github/workflows/next-release.yml +++ b/.github/workflows/next-release.yml @@ -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: diff --git a/package.json b/package.json index 4ecd7308ee..cdc6acb3b5 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/scripts/changeset-version-next.mjs b/scripts/changeset-version-next.mjs new file mode 100644 index 0000000000..c1aa2b0064 --- /dev/null +++ b/scripts/changeset-version-next.mjs @@ -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, () => {}); +})();