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
17 changes: 0 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,6 @@ jobs:
git commit -m "Update CHANGELOG.md for v$CURRENT_VERSION [skip ci]" --no-verify --allow-empty
git push origin next

# Sync the next.json version file to the main branch so it gets deployed to the docs site
# but only if this is a prerelease, because in minor/major releases we're already force pushing next-release onto main, so it's already there
- name: Sync version JSONs from `next-release` to `main`
if: github.ref_name == 'next-release' && steps.is-prerelease.outputs.prerelease == 'true'
working-directory: .
env:
CURRENT_VERSION: ${{ steps.version.outputs.current-version }}
run: |
VERSION_FILE="./docs/versions/next.json"
git fetch origin main
git checkout main
git pull
git checkout origin/next-release $VERSION_FILE
git add $VERSION_FILE
git commit -m "Update $VERSION_FILE for v$CURRENT_VERSION"
git push origin main

- name: Create Sentry release
if: steps.publish-needed.outputs.published == 'false'
uses: getsentry/action-release@v3
Expand Down
4 changes: 1 addition & 3 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@
"code/lib/codemod/src/transforms/__testfixtures__",
"code/frameworks/angular/template/**",
"code/lib/eslint-plugin",
"docs/versions/*.json",
".prettierrc",
"test-storybooks",
"*.yml",
"*.yaml",
"*.md",
"*.mdx",
"!docs/**",
"docs/versions/**"
"!docs/**"
],
"overrides": [
{
Expand Down
11 changes: 0 additions & 11 deletions CONTRIBUTING/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,6 @@ It's possible and valid to push manual changes directly on the release branch wh

It's recommended to use the automated process as much as possible to ensure that the information in GitHub is the single source of truth, and that pull requests and changelogs are in sync.

> **Warning**
> If you make manual changes to the changelog, you also need to make those changes in either [`./docs/versions/latest.json`](../docs/versions/latest.json) or [`./docs/versions/next.json`](../docs/versions/next.json). The `"plain"` property should match the changelog entry, **without the heading** and with all new lines replaces with `\n`.
> This is common for custom release notes when releasing majors and minors.

### 6. Merge

When the pull request was frozen, a CI run was triggered on the branch. If it's green, it's time to merge the pull request. If CI is failing for some reason, consult with the rest of the core team. These release pull requests are almost exact copies of `next|main` so CI should only fail if they fail too.
Expand Down Expand Up @@ -430,13 +426,6 @@ Before you start you should make sure that your working tree is clean and the re
4. `git add ./CHANGELOG.md`
5. `git commit -m "Update CHANGELOG.md for v<NEXT_VERSION>"`
6. `git push origin`
19. (If non-patch release) Sync `versions/next.json` from `next` to `main`
1. `git checkout main`
2. `git pull`
3. `git checkout origin/next ./docs/versions/next.json`
4. `git add ./docs/versions/next.json`
5. `git commit -m "Update versions/next.json for v<NEXT_VERSION_FROM_PREVIOUS_STEP>"`
6. `git push origin main`

## Canary Releases

Expand Down
1 change: 0 additions & 1 deletion docs/versions/latest.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/versions/next.json

This file was deleted.

20 changes: 3 additions & 17 deletions scripts/release/__tests__/write-changelog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ beforeEach(() => {

const STABLE_CHANGELOG_PATH = join(__dirname, '..', '..', '..', 'CHANGELOG.md');
const PRERELEASE_CHANGELOG_PATH = join(__dirname, '..', '..', '..', 'CHANGELOG.prerelease.md');
const LATEST_VERSION_PATH = join(__dirname, '..', '..', '..', 'docs', 'versions', 'latest.json');
const NEXT_VERSION_PATH = join(__dirname, '..', '..', '..', 'docs', 'versions', 'next.json');

const EXISTING_STABLE_CHANGELOG = dedent`## 7.0.0

Expand All @@ -54,7 +52,7 @@ describe('Write changelog', () => {

await writeChangelog(['7.0.1'], {});

expect(fsp.writeFile).toHaveBeenCalledTimes(2);
expect(fsp.writeFile).toHaveBeenCalledTimes(1);
expect(fsp.writeFile.mock.calls[0][0]).toBe(STABLE_CHANGELOG_PATH);
expect(fsp.writeFile.mock.calls[0][1]).toMatchInlineSnapshot(`
Comment thread
JReinhold marked this conversation as resolved.
"## 7.0.1
Expand All @@ -66,10 +64,6 @@ describe('Write changelog', () => {

- Core: Some change"
`);
expect(fsp.writeFile.mock.calls[1][0]).toBe(LATEST_VERSION_PATH);
expect(fsp.writeFile.mock.calls[1][1]).toMatchInlineSnapshot(
`"{"version":"7.0.1","info":{"plain":"- React: Make it reactive\\n- CLI: Not UI"}}"`
);
});

it('should escape double quotes for json files', async () => {
Expand All @@ -84,7 +78,7 @@ describe('Write changelog', () => {

await writeChangelog(['7.0.1'], {});

expect(fsp.writeFile).toHaveBeenCalledTimes(2);
expect(fsp.writeFile).toHaveBeenCalledTimes(1);
expect(fsp.writeFile.mock.calls[0][0]).toBe(STABLE_CHANGELOG_PATH);
expect(fsp.writeFile.mock.calls[0][1]).toMatchInlineSnapshot(`
"## 7.0.1
Expand All @@ -97,10 +91,6 @@ describe('Write changelog', () => {

- Core: Some change"
`);
expect(fsp.writeFile.mock.calls[1][0]).toBe(LATEST_VERSION_PATH);
expect(fsp.writeFile.mock.calls[1][1]).toMatchInlineSnapshot(
`"{"version":"7.0.1","info":{"plain":"- React: Make it reactive\\n- Revert \\\\\\"CLI: Not UI\\\\\\"\\n- CLI: Not UI"}}"`
);
});

it('should write to prerelease changelogs and version files in docs', async () => {
Expand All @@ -114,7 +104,7 @@ describe('Write changelog', () => {

await writeChangelog(['7.1.0-alpha.21'], {});

expect(fsp.writeFile).toHaveBeenCalledTimes(2);
expect(fsp.writeFile).toHaveBeenCalledTimes(1);
expect(fsp.writeFile.mock.calls[0][0]).toBe(PRERELEASE_CHANGELOG_PATH);
expect(fsp.writeFile.mock.calls[0][1]).toMatchInlineSnapshot(`
"## 7.1.0-alpha.21
Expand All @@ -126,9 +116,5 @@ describe('Write changelog', () => {

- CLI: Super fast now"
`);
expect(fsp.writeFile.mock.calls[1][0]).toBe(NEXT_VERSION_PATH);
expect(fsp.writeFile.mock.calls[1][1]).toMatchInlineSnapshot(
`"{"version":"7.1.0-alpha.21","info":{"plain":"- React: Make it reactive\\n- CLI: Not UI"}}"`
);
});
});
1 change: 0 additions & 1 deletion scripts/release/generate-pr-description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const CHANGE_TITLES_TO_IGNORE = [
/\[ci skip\]/i,
/^Update CHANGELOG\.md for.*/i,
/^Release: (Pre)?(Patch|Minor|Major|Release).*\d+$/i,
/^Update \.\/docs\/versions/,
];

export const mapToChangelist = ({
Expand Down
30 changes: 0 additions & 30 deletions scripts/release/write-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,35 +79,6 @@ const writeToChangelogFile = async ({
await writeFile(changelogPath, nextChangelog);
};

const writeToDocsVersionFile = async ({
changelogText,
version,
verbose,
}: {
changelogText: string;
version: string;
verbose?: boolean;
}) => {
const isPrerelease = semver.prerelease(version) !== null;
const filename = isPrerelease ? 'next.json' : 'latest.json';
const filepath = join(__dirname, '..', '..', 'docs', 'versions', filename);

if (verbose) {
console.log(`📝 Writing changelog to ${picocolors.blue(filepath)}`);
}

const textWithoutHeading = changelogText.split('\n').slice(2).join('\n').replaceAll('"', '\\"');

const content = {
version,
info: {
plain: textWithoutHeading,
},
};

await writeFile(filepath, JSON.stringify(content));
};

export const run = async (args: unknown[], options: unknown) => {
if (!validateOptions(args, options)) {
return;
Expand All @@ -129,7 +100,6 @@ export const run = async (args: unknown[], options: unknown) => {
}

await writeToChangelogFile({ changelogText, version, verbose });
await writeToDocsVersionFile({ changelogText, version, verbose });

console.log(`✅ Wrote Changelog to file`);
};
Expand Down
Loading