Fix release eliding (#3156)

Follow up to #3153, after testing some more I found some issues to fix.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [x] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [x] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Add a brief release note for your PR here.
This commit is contained in:
David Sheldrick 2024-03-14 15:41:55 +00:00 committed by GitHub
parent 44a3ea7363
commit 79d6058d3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View file

@ -58,7 +58,12 @@ function getTarballManifest(tarballPath: string): Promise<Record<string, Buffer>
onentry: (entry) => { onentry: (entry) => {
entry.on('data', (data) => { entry.on('data', (data) => {
// we could hash these to reduce memory but it's probably fine // we could hash these to reduce memory but it's probably fine
const existing = manifest[entry.path]
if (existing) {
manifest[entry.path] = Buffer.concat([existing, data])
} else {
manifest[entry.path] = data manifest[entry.path] = data
}
}) })
}, },
}, },
@ -74,9 +79,10 @@ function getTarballManifest(tarballPath: string): Promise<Record<string, Buffer>
} }
export async function didAnyPackageChange() { export async function didAnyPackageChange() {
const details = getAllPackageDetails() const details = await getAllPackageDetails()
for (const pkg of Object.values(details)) { for (const pkg of Object.values(details)) {
if (await hasPackageChanged(pkg)) { if (await hasPackageChanged(pkg)) {
console.log('Package changed:', pkg.name)
return true return true
} }
} }

View file

@ -18,9 +18,6 @@ async function main() {
const latestVersionOnNpm = (await exec('npm', ['show', 'tldraw', 'version'])).trim() const latestVersionOnNpm = (await exec('npm', ['show', 'tldraw', 'version'])).trim()
const isLatestVersion = latestVersionInBranch.format() === latestVersionOnNpm const isLatestVersion = latestVersionInBranch.format() === latestVersionOnNpm
if (process.env.GITHUB_OUTPUT) {
appendFileSync(process.env.GITHUB_OUTPUT, `is_latest_version=${isLatestVersion}\n`)
}
const nextVersion = latestVersionInBranch.inc('patch').format() const nextVersion = latestVersionInBranch.inc('patch').format()
// check we're on the main branch on HEAD // check we're on the main branch on HEAD
@ -53,6 +50,10 @@ async function main() {
return return
} }
if (process.env.GITHUB_OUTPUT) {
appendFileSync(process.env.GITHUB_OUTPUT, `is_latest_version=${isLatestVersion}\n`)
}
nicelog('Releasing version', nextVersion) nicelog('Releasing version', nextVersion)
await setAllVersions(nextVersion) await setAllVersions(nextVersion)