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
5 changes: 5 additions & 0 deletions .changeset/pretty-hats-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

deprecate: warn about implicit publishing in CI
Empty file added .context/notes.md
Empty file.
5 changes: 3 additions & 2 deletions packages/app-builder-lib/src/publish/PublishManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ export class PublishManager implements PublishContext {
if (!isPullRequest() || forcePublishForPr) {
if (publishOptions.publish === undefined) {
if (process.env.npm_lifecycle_event === "release") {
log.warn("Implicit publishing triggered by npm lifecycle event 'release'. This behavior will be disabled in electron-builder v27. Please use --publish explicitly.")
publishOptions.publish = "always"
} else {
const tag = getCiTag()
if (tag != null) {
log.info({ reason: "tag is defined", tag }, "artifacts will be published")
log.warn({ tag }, "Implicit publishing triggered by git tag. This behavior will be disabled in electron-builder v27. Please use --publish explicitly.")
publishOptions.publish = "onTag"
} else if (isCI) {
log.info({ reason: "CI detected" }, "artifacts will be published if draft release exists")
log.warn("Implicit publishing triggered by CI detection. This behavior will be disabled in electron-builder v27. Please use --publish explicitly.")
publishOptions.publish = "onTagOrDraft"
}
}
Expand Down
11 changes: 11 additions & 0 deletions pages/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ If `GITHUB_RELEASE_TOKEN` is defined, it will be used instead of (`GH_TOKEN` or
- you could make your `GITHUB_TOKEN` "Read-only" when creating a fine-grained personal access token, and "Read and write" for the `GITHUB_RELEASE_TOKEN`.
- "Contents" fine-grained permission was sufficient. (at time of writing - Apr 2024)

!!! warning "Deprecation Notice: Implicit Publishing"
electron-builder currently auto-detects when to publish based on CI environment conditions:

- Running via `npm run release` → publishes always
- Git tag detected in CI → publishes on tag
- CI environment detected → publishes to draft releases

**This implicit publishing behavior is deprecated and will be disabled in electron-builder v27.**

To prepare for this change, please explicitly specify your publish intent using the `--publish` CLI flag (e.g., `--publish always`, `--publish onTag`) or set the `publish` configuration in your `package.json` or `electron-builder.yml`.

!!! info "Snap store"
`snap` target by default publishes to snap store (the app store for Linux). To force publishing to another providers, explicitly specify publish configuration for `snap`.

Expand Down