-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore(snap): migrate snap generation from app-builder-bin to JS #8892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mmaietta
wants to merge
39
commits into
master
Choose a base branch
from
snap-js-migration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
7161ff0
tmp save
mmaietta fa3a7f8
everything builds
mmaietta 3fb49c9
convert to SnapBuilderOptions
mmaietta 35f363d
everything builds
mmaietta cc6bf7e
add more helpers
mmaietta 5cf634e
cleanup
mmaietta 78eacf3
snap tests pass
mmaietta 5dbbb3e
cleanup?
mmaietta d76121e
Merge commit 'e4d51475676819fc1c92f43b954171b1154d3290' into snap-js-…
mmaietta 16b347e
clean up part 1
mmaietta cbb2a27
cleanup 3
mmaietta 742a0fc
cleanup 4
mmaietta 6ee53b0
cleanup 5
mmaietta 2a68308
Merge branch 'master' into snap-js-migration
mmaietta aff2805
move snap tests to macos so that we can install snapcraft and multipass
mmaietta 3f79884
move back to linux runner
mmaietta 0be7bbd
test running snaptest on ubuntu runner?
mmaietta 4690ae4
add sudo
mmaietta 5a9c9c3
run in band
mmaietta 8bdb942
multipass parallel?
mmaietta 58051ac
only skip multipass tests
mmaietta db11629
update snapshots
mmaietta 5eb372b
run all tests and update snapshots
mmaietta e7e3468
Merge branch 'master' into snap-js-migration
mmaietta 34fcff6
cleanup
mmaietta 0d7981c
add snapHeavyTest to GH runner
mmaietta 3409ede
guess we cant run snapHeavyTest on GH runner due to multipass being u…
mmaietta 873106f
Create empty-files-itch.md
mmaietta f30c812
Merge branch 'master' into snap-js-migration
mmaietta 249790b
Merge commit '67b6f71f85798dba4ce51dfb2cd012e04cd391db' into snap-js-…
mmaietta 00158e7
pr feedback
mmaietta de61d2a
Merge branch 'master' into snap-js-migration
mmaietta 44325b9
convert `chmod -R` to `await chmod`
mmaietta 8197563
update warning message
mmaietta ac96cb8
move templates to `template` dir
mmaietta fde0731
read files instead of byte string and refactor
mmaietta 5cd59d4
add more snapshots because why not
mmaietta f0a9c3b
Merge branch 'master' into snap-js-migration
mmaietta aef891c
Merge branch 'master' into snap-js-migration
beyondkmp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"app-builder-lib": patch | ||
"builder-util": patch | ||
"electron-publish": patch | ||
--- | ||
|
||
chore(snap): migrate snap generation from app-builder-bin to JS |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"templates", | ||
"scheme.json", | ||
"certs/root_certs.keychain" | ||
|
||
], | ||
"repository": { | ||
"type": "git", | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { isEmptyOrSpaces } from "builder-util" | ||
import { getBinFromUrl } from "../../binDownload" | ||
import * as os from "os" | ||
import * as path from "path" | ||
import { Lazy } from "lazy-val" | ||
|
||
const appImageToolDir = new Lazy<string>(() => getBinFromUrl("appimage", "12.0.1", "3el6RUh6XoYJCI/ZOApyb0LLU/gSxDntVZ46R6+JNEANzfSo7/TfrzCRp5KlDo35c24r3ZOP7nnw4RqHwkMRLw==")) | ||
|
||
function getAppImageToolBin(toolDir: string): string { | ||
return process.platform === "darwin" ? path.join(toolDir, "darwin") : path.join(toolDir, `linux-${goArchToArchSuffix()}`) | ||
} | ||
|
||
function goArchToArchSuffix(): string { | ||
const arch = os.arch() | ||
switch (arch) { | ||
case "arm": | ||
return "arm32" | ||
default: | ||
return arch | ||
} | ||
} | ||
|
||
async function getLinuxTool(name: string): Promise<string> { | ||
const toolDir = await appImageToolDir.value | ||
return path.join(getAppImageToolBin(toolDir), name) | ||
} | ||
|
||
export async function getMksquashfs(): Promise<string> { | ||
if (process.env.USE_SYSTEM_MKSQUASHFS) { | ||
return "mksquashfs" | ||
} | ||
if (!isEmptyOrSpaces(process.env.MKSQUASHFS_PATH)) { | ||
return process.env.MKSQUASHFS_PATH | ||
} | ||
return getLinuxTool("mksquashfs") | ||
} |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.