-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close #3187
- Loading branch information
Showing
20 changed files
with
100 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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
49 changes: 49 additions & 0 deletions
49
packages/app-builder-lib/src/publish/SnapStorePublisher.ts
This file contains 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,49 @@ | ||
import { Publisher, UploadTask, PublishContext } from "electron-publish" | ||
import { executeAppBuilder } from "builder-util" | ||
import * as path from "path" | ||
import { PublishConfiguration } from "builder-util-runtime" | ||
|
||
export class SnapStorePublisher extends Publisher { | ||
readonly providerName = "snapStore" | ||
|
||
constructor(context: PublishContext, private options: SnapStoreOptions) { | ||
super(context) | ||
} | ||
|
||
upload(task: UploadTask): Promise<any> { | ||
this.createProgressBar(path.basename(task.file), -1) | ||
|
||
const args = ["publish-snap", "-f", task.file] | ||
|
||
let channels = this.options.channels | ||
if (channels == null) { | ||
channels = ["edge"] | ||
} | ||
else { | ||
if (typeof channels === "string") { | ||
channels = channels.split(",") | ||
} | ||
} | ||
|
||
for (const channel of channels) { | ||
args.push("-c", channel) | ||
} | ||
|
||
return executeAppBuilder(args) | ||
} | ||
|
||
toString(): string { | ||
return "Snap Store" | ||
} | ||
} | ||
|
||
/** | ||
* [Snap Store](https://snapcraft.io/) options. | ||
*/ | ||
export interface SnapStoreOptions extends PublishConfiguration { | ||
/** | ||
* The list of channels the snap would be released. | ||
* @default ["edge"] | ||
*/ | ||
readonly channels?: string | Array<string> | null | ||
} |
2 changes: 1 addition & 1 deletion
2
...lectron-publish/src/s3/BaseS3Publisher.ts → ...der-lib/src/publish/s3/BaseS3Publisher.ts
This file contains 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
2 changes: 1 addition & 1 deletion
2
...es/electron-publish/src/s3/s3Publisher.ts → ...builder-lib/src/publish/s3/s3Publisher.ts
This file contains 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
2 changes: 1 addition & 1 deletion
2
...lectron-publish/src/s3/spacesPublisher.ts → ...der-lib/src/publish/s3/spacesPublisher.ts
This file contains 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 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 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 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 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 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 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 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 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 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 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