Skip to content

Commit ef43f42

Browse files
authored
chore: Add v26 deprecation warning about implicit publishing in CI (#9475)
1 parent cb5b9c6 commit ef43f42

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

.changeset/pretty-hats-appear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
deprecate: warn about implicit publishing in CI

.context/notes.md

Whitespace-only changes.

packages/app-builder-lib/src/publish/PublishManager.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ export class PublishManager implements PublishContext {
8686
if (!isPullRequest() || forcePublishForPr) {
8787
if (publishOptions.publish === undefined) {
8888
if (process.env.npm_lifecycle_event === "release") {
89+
log.warn("Implicit publishing triggered by npm lifecycle event 'release'. This behavior will be disabled in electron-builder v27. Please use --publish explicitly.")
8990
publishOptions.publish = "always"
9091
} else {
9192
const tag = getCiTag()
9293
if (tag != null) {
93-
log.info({ reason: "tag is defined", tag }, "artifacts will be published")
94+
log.warn({ tag }, "Implicit publishing triggered by git tag. This behavior will be disabled in electron-builder v27. Please use --publish explicitly.")
9495
publishOptions.publish = "onTag"
9596
} else if (isCI) {
96-
log.info({ reason: "CI detected" }, "artifacts will be published if draft release exists")
97+
log.warn("Implicit publishing triggered by CI detection. This behavior will be disabled in electron-builder v27. Please use --publish explicitly.")
9798
publishOptions.publish = "onTagOrDraft"
9899
}
99100
}

pages/publish.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ If `GITHUB_RELEASE_TOKEN` is defined, it will be used instead of (`GH_TOKEN` or
1717
- 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`.
1818
- "Contents" fine-grained permission was sufficient. (at time of writing - Apr 2024)
1919

20+
!!! warning "Deprecation Notice: Implicit Publishing"
21+
electron-builder currently auto-detects when to publish based on CI environment conditions:
22+
23+
- Running via `npm run release` → publishes always
24+
- Git tag detected in CI → publishes on tag
25+
- CI environment detected → publishes to draft releases
26+
27+
**This implicit publishing behavior is deprecated and will be disabled in electron-builder v27.**
28+
29+
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`.
30+
2031
!!! info "Snap store"
2132
`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`.
2233

0 commit comments

Comments
 (0)