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
22 changes: 22 additions & 0 deletions .changeset/changelog-summary.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Changelog lines with the changeset's summary only. The default, @changesets/cli/changelog, prefixes
// each line with the commit that added the changeset. Releases are versioned before the changes reach
// this repository, so those hashes wouldn't resolve here or from npm.
// Otherwise the same output as @changesets/changelog-git.

const changelogFunctions = {
getReleaseLine: async (changeset) => {
const [firstLine, ...futureLines] = changeset.summary.split("\n").map((l) => l.trimEnd());
let returnVal = `- ${firstLine}`;
if (futureLines.length > 0) returnVal += `\n${futureLines.map((l) => ` ${l}`).join("\n")}`;
return returnVal;
},
getDependencyReleaseLine: async (_changesets, dependenciesUpdated) => {
if (dependenciesUpdated.length === 0) return "";
const updatedDependenciesList = dependenciesUpdated.map(
(dependency) => ` - ${dependency.name}@${dependency.newVersion}`,
);
return ["- Updated dependencies", ...updatedDependenciesList].join("\n");
},
};

export default changelogFunctions;
8 changes: 5 additions & 3 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": "@changesets/cli/changelog",
"$schema": "https://unpkg.com/@changesets/config@4.0.1/schema.json",
"changelog": "./changelog-summary.mjs",
"commit": false,
"fixed": [
["@shopify/prettier-plugin-liquid"],
Expand All @@ -12,5 +12,7 @@
"linked": [],
"access": "public",
"baseBranch": "origin/main",
"updateInternalDependencies": "patch"
"updateInternalDependencies": "patch",
"privatePackages": { "version": true, "tag": false },
"format": false
}
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
publish-packages:
runs-on: ubuntu-latest
outputs:
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
hasChangesets: ${{ steps.changesets.outputs.has-changesets }}
permissions:
contents: write
pull-requests: write
Expand Down Expand Up @@ -68,30 +68,30 @@ jobs:

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1.9.0
# v2 is the version that runs Changesets 3
uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
# Put date in the title and commit message
title: "Theme Tools Release — ${{ steps.date.outputs.date }}"
commit: "Theme Tools Release — ${{ steps.date.outputs.date }}"
pr-title: "Theme Tools Release — ${{ steps.date.outputs.date }}"
commit-message: "Theme Tools Release — ${{ steps.date.outputs.date }}"
# When there are no changesets, this gets called
publish: pnpm changeset publish
publish-script: pnpm changeset publish
# When there are changesets, this gets called and then a PR is opened/updated
version: pnpm release
version-script: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PNPM_CONFIG_PROVENANCE: true

- name: Clear GitHub credentials before marketplace publish
run: rm -f "$HOME/.netrc"

- name: VS Code Marketplace publish
if: steps.changesets.outputs.hasChangesets == 'false' && steps.marketplace-version.outputs.version != steps.package-version.outputs.version
if: steps.changesets.outputs.has-changesets == 'false' && steps.marketplace-version.outputs.version != steps.package-version.outputs.version
run: pnpm publish:vsce
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

- name: Open VSX Registry publish
if: steps.changesets.outputs.hasChangesets == 'false' && steps.marketplace-version.outputs.version != steps.package-version.outputs.version
if: steps.changesets.outputs.has-changesets == 'false' && steps.marketplace-version.outputs.version != steps.package-version.outputs.version
run: pnpm publish:ovsx
env:
OVSX_PAT: ${{ secrets.OPENVSX_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"type-check": "pnpm -r --workspace-concurrency=1 type-check"
},
"devDependencies": {
"@changesets/cli": "^2.26.0",
"@changesets/cli": "3.0.3",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"html-webpack-plugin": "^5.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('changeset', () => {

await changesetTag();

expect(run).toHaveBeenCalledWith('pnpm exec changeset tag');
expect(run).toHaveBeenCalledWith('pnpm exec changeset git-tag');
expect(console.log).toHaveBeenCalledWith('Creating git tags for package versions...');
expect(console.log).toHaveBeenCalledWith('test output');
});
Expand Down
2 changes: 1 addition & 1 deletion packages/release-orchestrator/src/steps/changesetTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { run } from '../utils';

export const changesetTag = async () => {
console.log('Creating git tags for package versions...');
console.log(await run('pnpm exec changeset tag'));
console.log(await run('pnpm exec changeset git-tag'));
};
Loading
Loading