Minor tidy up in the release manifest generation script - #147
Merged
Conversation
The idea being that it's more compact this way, rather than defining a reusable value that is only ever used once.
mokagio
commented
May 21, 2024
Comment on lines
+17
to
+18
| // "x64": { | ||
| // "sha": "abcdef1234567890", | ||
| // "url": "https://cdn.a8c-ci.services/studio/studio-win32-x64-abcdef1234567890.exe.zip" | ||
| // } | ||
| // "sha": "abcdef1234567890", | ||
| // "url": "https://cdn.a8c-ci.services/studio/studio-win32-x64-abcdef1234567890.exe.zip" |
Contributor
Author
There was a problem hiding this comment.
There's no additional architecture sub-level for the Windows builds.
mokagio
commented
May 21, 2024
mokagio
commented
May 21, 2024
Comment on lines
-138
to
+140
| const releaseVersionZipFilenameMac = `https://cdn.a8c-ci.services/studio/studio-darwin-v${ version }.app.zip`; | ||
| const releaseVersionZipFilenameX64 = `https://cdn.a8c-ci.services/studio/studio-darwin-x64-v${ version }.app.zip`; | ||
| const releaseVersionZipFilenameArm64 = `https://cdn.a8c-ci.services/studio/studio-darwin-arm64-v${ version }.app.zip`; | ||
| const releaseVersionZipFilenameWin32 = `https://cdn.a8c-ci.services/studio/studio-win32-v${ version }.exe`; | ||
|
|
||
| releasesData[ version ] = releasesData[ version ] ?? {}; | ||
|
|
||
| // macOS | ||
| releasesData[ version ][ 'darwin' ] = releasesData[ version ][ 'darwin' ] ?? {}; | ||
| releasesData[ version ][ 'darwin' ][ 'universal' ] = { | ||
| sha: currentCommit, | ||
| url: releaseVersionZipFilenameMac, | ||
| url: `${ cdnURL }/${ baseName }-darwin-v${ version }.app.zip`, |
Contributor
Author
There was a problem hiding this comment.
Personal take: It's cleaner to inline these URL definitions since they are only ever used once.
wojtekn
approved these changes
May 21, 2024
| // "url": "https://cdn.a8c-ci.services/studio/studio-win32-x64-abcdef1234567890.exe.zip" | ||
| // } | ||
| // "sha": "abcdef1234567890", | ||
| // "url": "https://cdn.a8c-ci.services/studio/studio-win32-abcdef1234567890.exe.zip" |
Contributor
There was a problem hiding this comment.
Looks good, thanks for fixing the example according the implementation.
I've added https://github.com/Automattic/dotcom-forge/issues/7317 to add support for Windows in the updates endpoint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Today, I looked at the manifest script as the base for a similar functionality in another app. I noticed a minor error in the documentation and a few opportunities to improve the maintainability.
Testing Instructions
Run
node ./scripts/generate-releases-manifest.mjsand ensureout/releases.jsonis modified as expected.Pre-merge Checklist