launchset 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,6 +107,9 @@
107
107
  },
108
108
  "additionalProperties": false
109
109
  },
110
+ "baseline": {
111
+ "type": "string"
112
+ },
110
113
  "check": {
111
114
  "default": {},
112
115
  "type": "object",
@@ -753,6 +756,24 @@
753
756
  "kind"
754
757
  ],
755
758
  "additionalProperties": false
759
+ },
760
+ {
761
+ "type": "object",
762
+ "properties": {
763
+ "kind": {
764
+ "type": "string",
765
+ "const": "flutter"
766
+ },
767
+ "dir": {
768
+ "default": ".",
769
+ "type": "string",
770
+ "minLength": 1
771
+ }
772
+ },
773
+ "required": [
774
+ "kind"
775
+ ],
776
+ "additionalProperties": false
756
777
  }
757
778
  ]
758
779
  },
@@ -1069,6 +1090,24 @@
1069
1090
  "kind"
1070
1091
  ],
1071
1092
  "additionalProperties": false
1093
+ },
1094
+ {
1095
+ "type": "object",
1096
+ "properties": {
1097
+ "kind": {
1098
+ "type": "string",
1099
+ "const": "flutter"
1100
+ },
1101
+ "dir": {
1102
+ "default": ".",
1103
+ "type": "string",
1104
+ "minLength": 1
1105
+ }
1106
+ },
1107
+ "required": [
1108
+ "kind"
1109
+ ],
1110
+ "additionalProperties": false
1072
1111
  }
1073
1112
  ]
1074
1113
  },
@@ -609,6 +609,10 @@ const androidSourceSchema = z.discriminatedUnion("kind", [
609
609
  z.strictObject({
610
610
  kind: z.literal("expo"),
611
611
  file: nonEmpty.default("app.json")
612
+ }),
613
+ z.strictObject({
614
+ kind: z.literal("flutter"),
615
+ dir: nonEmpty.default(".")
612
616
  })
613
617
  ]);
614
618
  const androidTargetSchema = z.strictObject({
@@ -649,6 +653,10 @@ const iosSourceSchema = z.discriminatedUnion("kind", [
649
653
  z.strictObject({
650
654
  kind: z.literal("expo"),
651
655
  file: nonEmpty.default("app.json")
656
+ }),
657
+ z.strictObject({
658
+ kind: z.literal("flutter"),
659
+ dir: nonEmpty.default(".")
652
660
  })
653
661
  ]);
654
662
  const iosTargetSchema = z.strictObject({
@@ -751,6 +759,12 @@ const configSchema = z.strictObject({
751
759
  partial: placeholderTemplate(["version"]).default("launchset/partial/{version}")
752
760
  }).prefault({}),
753
761
  buildNumber: buildNumberSchema.prefault({}),
762
+ /**
763
+ * The version that was released before launchset took over (init writes it). When its
764
+ * release tag doesn't exist, the release workflow on the base branch creates it at the commit
765
+ * it runs on, without building anything (spec 11.1 step 5).
766
+ */
767
+ baseline: z.string().refine(isPlainVersion, { message: "expected a plain version like \"1.4.0\"" }).optional(),
754
768
  check: z.strictObject({ bots: z.array(nonEmpty).default(DEFAULT_BOTS) }).prefault({}),
755
769
  /** `false` disables previews and prerelease branches (needed for the `semver` strategy). */
756
770
  preview: z.union([z.literal(false), previewSchema], { error: "expected false (to disable previews) or an object with preview settings" }).prefault({}),
@@ -988,6 +1002,18 @@ function unitIssues(data) {
988
1002
  }
989
1003
  return issues;
990
1004
  }
1005
+ /**
1006
+ * How `version.file` is read and written: a file named `pubspec.yaml` is a Flutter or Dart
1007
+ * pubspec (its `version`, without the `+build` suffix), anything else a JSON file with a
1008
+ * top-level `"version"` (`package.json`).
1009
+ */
1010
+ function versionFileFormat(file) {
1011
+ return /(^|[\\/])pubspec\.yaml$/.test(file) ? "pubspec" : "json";
1012
+ }
1013
+ /** How to add a missing version to `version.file`, in that file's own syntax. */
1014
+ function rootVersionHint(file) {
1015
+ return versionFileFormat(file) === "pubspec" ? "Add a top-level version, e.g. `version: 0.1.0+1`." : "Add a \"version\" field, e.g. \"version\": \"0.1.0\".";
1016
+ }
991
1017
  /** Cross-field rules from spec 5 that zod's per-field checks can't express. */
992
1018
  function semanticIssues(config) {
993
1019
  const issues = [];
@@ -1004,6 +1030,10 @@ function semanticIssues(config) {
1004
1030
  path: "targets",
1005
1031
  message: "expected at least one target with release: \"auto\" (otherwise no release completes)"
1006
1032
  });
1033
+ if (/\.ya?ml$/i.test(config.version.file) && versionFileFormat(config.version.file) !== "pubspec") issues.push({
1034
+ path: "version.file",
1035
+ message: "expected a package.json-style JSON file or a Flutter pubspec.yaml; other YAML files can't hold the version"
1036
+ });
1007
1037
  if (config.tags.partial === config.tags.release) issues.push({
1008
1038
  path: "tags.partial",
1009
1039
  message: "must differ from tags.release (a partial release must never look like a release)"
@@ -1042,6 +1072,10 @@ function semanticIssues(config) {
1042
1072
  });
1043
1073
  });
1044
1074
  }
1075
+ if ((target.type === "android" || target.type === "ios") && target.source.kind === "flutter" && target.buildNumber.strategy === "eas") issues.push({
1076
+ path: `${base}.buildNumber.strategy`,
1077
+ message: "the \"eas\" strategy is for Expo builds numbered by EAS; a Flutter app needs a build number from launchset (use \"timestamp\", \"run-number\" or \"semver\")"
1078
+ });
1045
1079
  if (target.type === "android" && target.verify.includes("store") && !target.store) issues.push({
1046
1080
  path: `${base}.store.packageName`,
1047
1081
  message: "verify: [\"store\"] needs store.packageName"
@@ -1199,4 +1233,4 @@ function resolveConfig(input, options = {}) {
1199
1233
  function defineConfig(config) {
1200
1234
  return config;
1201
1235
  }
1202
- export { isPlainVersion as A, releaseVersion as B, matchBranch as C, compareVersions as D, branchSlug as E, parseMaintenanceBranch as F, BUMPS as H, prPreviewVersion as I, prereleaseVersion as L, maintenanceViolations as M, marketingVersion as N, distTag as O, nextPrereleaseNumber as P, previewBaseVersion as R, isMaintenanceBranch as S, branchPreviewVersion as T, escapeRegExp as U, versionParts as V, ciProfile as _, configSchema as a, isForgeHost as b, hostConfigIssues as c, CI_SYSTEMS as d, DEFAULT_HOST as f, ciOf as g, ciFromEnv as h, TARGET_NAME as i, maintenanceBranchName as j, highestVersion as k, resolveConfig as l, HOSTS as m, DEFAULT_DOCKER_TAGS as n, defineConfig as o, FORGE_HOSTS as p, DOCKER_TAG_PLACEHOLDERS as r, gitlabSettings as s, ConfigError as t, targetShell as u, ciSystemFor as v, baseVersionOf as w, findPreviewBranch as x, hostProfile as y, releaseBump as z };
1236
+ export { distTag as A, previewBaseVersion as B, findPreviewBranch as C, branchPreviewVersion as D, baseVersionOf as E, marketingVersion as F, escapeRegExp as G, releaseVersion as H, nextPrereleaseNumber as I, parseMaintenanceBranch as L, isPlainVersion as M, maintenanceBranchName as N, branchSlug as O, maintenanceViolations as P, prPreviewVersion as R, isForgeHost as S, matchBranch as T, versionParts as U, releaseBump as V, BUMPS as W, ciFromEnv as _, configSchema as a, ciSystemFor as b, hostConfigIssues as c, targetShell as d, versionFileFormat as f, HOSTS as g, FORGE_HOSTS as h, TARGET_NAME as i, highestVersion as j, compareVersions as k, resolveConfig as l, DEFAULT_HOST as m, DEFAULT_DOCKER_TAGS as n, defineConfig as o, CI_SYSTEMS as p, DOCKER_TAG_PLACEHOLDERS as r, gitlabSettings as s, ConfigError as t, rootVersionHint as u, ciOf as v, isMaintenanceBranch as w, hostProfile as x, ciProfile as y, prereleaseVersion as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "launchset",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Changesets-style releases for lock-step monorepos: one version, many targets (Docker, Android, iOS, web).",
5
5
  "keywords": [
6
6
  "release",
@@ -14,6 +14,7 @@
14
14
  "react-native",
15
15
  "capacitor",
16
16
  "expo",
17
+ "flutter",
17
18
  "github-actions",
18
19
  "gitlab-ci"
19
20
  ],
@@ -147,7 +147,7 @@ If the workflow here is to push to the base branch without a PR, make sure a cha
147
147
 
148
148
  ## Never do these
149
149
 
150
- - **Never edit version numbers or build numbers by hand.** Not in `package.json`, `build.gradle`, `project.pbxproj`, `Info.plist`, `app.json`, Helm charts, or anywhere else a target's version lives. The release PR writes versions. CI writes build numbers. The PR check fails when a version file disagrees with the root version.
150
+ - **Never edit version numbers or build numbers by hand.** Not in `package.json`, `build.gradle`, `project.pbxproj`, `Info.plist`, `app.json`, `pubspec.yaml` (also not the `+N` after the version), Helm charts, or anywhere else a target's version lives. The release PR writes versions. CI writes build numbers. The PR check fails when a version file disagrees with the root version.
151
151
  - **Never edit `CHANGELOG.md`.** The release PR adds sections.
152
152
  - **Never create tags that start with `v` or `launchset/`** (or whatever the repo's launchset config sets in `tags`). They are launchset's release, marker and partial tags, and creating them can trigger or block releases.
153
153
  - **Never edit or push to the release PR** (branch `launchset/release/*`). It is rebuilt and force-pushed on every run. Change the changesets on the base branch instead.
@@ -16,7 +16,7 @@ Use `npx launchset` (Node 24 or newer). If `npx` can't run it, tell the human an
16
16
  1. **Detect first. Write nothing until the human has seen the decisions.** `init --detect` never writes.
17
17
  2. **Ask only what matters**, with the evidence. Don't ask about decisions whose default is clearly right.
18
18
  3. **Never handle secret values.** Certificates, keys, passwords, tokens and service accounts are created and stored by a human. You check names, never values.
19
- 4. **Never lower a version, and never create a baseline tag, without the human's explicit answer.**
19
+ 4. **Never lower a version, and never set a baseline, without the human's explicit answer. Never create or push the baseline tag yourself**: the release workflow creates it after the merge (see Step 2).
20
20
  5. **Keep existing conventions** (tag format, Docker image tags) unless the human decides otherwise. Deploy tooling depends on them.
21
21
  6. **Remove or adapt conflicting machinery only after the human agrees.**
22
22
  7. **Don't migrate what doesn't fit**, and say why (see the end).
@@ -52,7 +52,9 @@ If `init` fails with `already-initialized`, the repo already has a config: don't
52
52
  Group the decisions for the human. Ask the ones with `"ask": true`, and these three **always**:
53
53
 
54
54
  1. **Lowering any version.** The default is the highest version found, and it never lowers one. If the human wants a lower one, `--decide version=<lower>` is the only way, and init warns about each file that goes down. Explain: stores reject lower marketing versions, and image tags would go backwards.
55
- 2. **A baseline tag** for a version that has no release tag (`baseline`). A baseline tag makes launchset treat the version as already released, so it never builds it, and pinned images might not exist. Default `yes` only when a tag in another format already marks it as released. Without a baseline tag, if the PR changes the root version, merging it is read as a release of that version and builds every target.
55
+ 2. **A baseline** for a version that has no release tag (`baseline`). A baseline makes launchset treat the version as already released, so it never builds it, and pinned images might not exist. Default `yes` only when a tag in another format already marks it as released. Without a baseline, if the PR changes the root version, merging it is read as a release of that version and builds every target.
56
+
57
+ init writes `baseline: "<version>"` to the config; it doesn't create the tag. The first release workflow run on the base branch **after the migration PR is merged** creates `v<version>` at the commit it runs on, without building anything. Never create or push that tag yourself, not even after the merge, and don't tell the human to: pushing a tag runs the tag-triggered workflows **of the commit it points to**, and HEAD before the migration still has the old ones (`detection.machinery[]` with kind `tag-trigger`). They would run again for that version: push images and move `latest`, publish to npm or the stores, create a GitHub Release. Explain this to the human when the repo has such workflows.
56
58
  3. **Native projects that no workflow builds** (`target.<name>`, proposed `manual`). Suggest `release: "manual"` and explain: the version is stamped by every release so native files never drift, but the store build is shipped on demand with a workflow run or `launchset ship`, and the release tag doesn't wait for it. The alternatives are `auto` (every release builds and uploads it) and `none` (not a target).
57
59
 
58
60
  The decision ids and values:
@@ -61,6 +63,7 @@ The decision ids and values:
61
63
  | --- | --- | --- |
62
64
  | `host` | `github`, `gitlab` | The code host. Only listed when something points at GitLab (a GitLab remote, `.gitlab-ci.yml`). Check it: it decides which CI files init writes. |
63
65
  | `version` | plain `X.Y.Z` | The version the repo is on. |
66
+ | `version.file` | a Flutter app's `pubspec.yaml`, or `package.json` | Only when the repo has no `package.json` and has a Flutter app. Default: the app's `pubspec.yaml` holds the version. `package.json` makes init create one that only holds the version. Ask when there are several Flutter apps. |
64
67
  | `tags.release` | template with `{version}` | The release tag format. Keep the existing one, for example `{version}` without a `v`. |
65
68
  | `target.<name>` | `auto`, `manual`, `none` (`custom`: declare a target init didn't detect) | How a detected platform is released. This includes custom targets from jobs that run on release tags and keep artifacts, deploy or publish: on GitLab named after the job (`package:windows` is `windows`), on GitHub after the workflow file (`desktop-linux.yml` is `desktop-linux`). Their tag trigger is retired, so without the target the build would stop running for releases. `--decide target.<name>=custom` adds a custom target nothing detected, for a project init finds nothing in. |
66
69
  | `gitlab.<name>.shell` | `sh`, `powershell` | GitLab custom targets from a job: the runner's shell. `powershell` when the job's scripts use PowerShell or it runs on a `windows`-tagged runner. |
@@ -71,7 +74,7 @@ The decision ids and values:
71
74
  | `machinery.<path>#<n>` | `remove`, `disable`, `keep` | What to do with one piece of conflicting machinery. Copy the exact `id` from the JSON (a path starting with a dot gives `machinery..github/workflows/x.yml#1`). |
72
75
  | `image.<path>` | `stamp`, `leave` | Whether the release PR updates the image tag a deploy manifest pins. |
73
76
  | `file.<path>` | `keep`, `overwrite` | A file init would write already exists (`.launchset/README.md`, `launchset-*.yml`). Default `keep`: it stays as it is. `overwrite` replaces it with the newly generated file. Ask only if the existing file looks hand-edited and should be regenerated. |
74
- | `baseline` | `yes`, `no` | Create the release tag for the version at HEAD. |
77
+ | `baseline` | `yes`, `no` | Mark the version as released: `baseline` in the config, and the first release workflow run after the merge creates its release tag. |
75
78
  | `offset` | integer `>= 0` | `buildNumber.offset`, so new build numbers stay above the existing ones. |
76
79
  | `skill` | `yes`, `no` | Install the `launchset` skill and an `AGENTS.md` section. |
77
80
  | `hook` | `yes`, `no` | Add `launchset check --push` to the existing pre-push hook. Only exists when a hook setup was found. |
@@ -83,7 +86,7 @@ launchset pushes its tags and creates GitHub Releases with a GitHub App token, w
83
86
  - **Tag-triggered workflows** (`on: push: tags: v*` and similar): they would fire again on launchset's release tag and build or publish twice.
84
87
  - **Changesets**: `changesets/action`, `changeset version|status|publish|tag` in workflows or `package.json` scripts, `@changesets/write`. launchset's release PR replaces them. Exception: when Changesets also publishes npm packages that have their own versions, it stays for those packages (see "Repos that also publish npm packages" below).
85
88
  - **Other release tools** (semantic-release, release-it, standard-version, release-please) and steps that create tags or GitHub Releases (`git tag`, `gh release create`): launchset's finalize creates `v<version>`.
86
- - **Scripts that write version or build numbers** (`MARKETING_VERSION`, `CURRENT_PROJECT_VERSION`, `versionCode`, `versionName`, fastlane version actions): they would overwrite the numbers stamped in CI.
89
+ - **Scripts that write version or build numbers** (`MARKETING_VERSION`, `CURRENT_PROJECT_VERSION`, `versionCode`, `versionName`, fastlane version actions, and for Flutter `cider`, `pubver`, `sed -i` / `yq -i` on `pubspec.yaml` or a Dart script in `tool/` that rewrites its `version`): they would overwrite the numbers stamped in CI. `melos version` counts as another release tool.
87
90
  - **Docker pushes of `latest` on branch pushes**: launchset moves `latest` only when a release ships.
88
91
  - **On GitLab:** the same kinds of machinery in `.gitlab-ci.yml` and the local files it includes: jobs that run on tags (`$CI_COMMIT_TAG`), `glab release create`, the `release:` keyword, `npm publish`, Docker pushes of `latest` from branch pushes. Remote, project and template includes aren't scanned: read them yourself. For a tag job that something else starts too (`- when: manual` for a trial build, a branch rule), `disable` removes only its tag rule; a job that only other removed jobs need can go with them (its decision is only offered while those are disabled). A note says when `workflow: rules` let tag pipelines run: launchset's own tags start none (it pushes them with `-o ci.skip`), but explain that other tag pushes still do, and that the rule may only have served the release jobs being retired.
89
92
  - **Release instructions** in `CLAUDE.md`, `AGENTS.md` and the README (`npm version`, `git tag`, `changeset`): they describe the old process.
@@ -95,6 +98,7 @@ Also check, by reading the repo:
95
98
  - **Long-lived Changesets pre-mode branches** (`.changeset/pre.json` on a branch): propose a prerelease branch entry (`preview.branches: [{ branch: "next", prerelease: "beta" }]`) and, on that branch, `npx launchset init --convert-only`. `pre.json` is ignored with a warning.
96
99
  - **Deploy manifests that pin an image tag** (`imagePins[]`): ask per file. `image.<path>=stamp` makes the release PR update it to each release. `leave` keeps it as deploy state that is promoted by hand (for example a production overlay).
97
100
  - **Docker image names and tags**: keep what deploy tooling pulls (`v{version}`).
101
+ - **Flutter apps** (`detection.flutterApps`): their targets use `source: { kind: "flutter", dir }` and stamp only `pubspec.yaml`. Show the human every warning note about native projects that don't read Flutter's numbers (`versionCode` not `flutter.versionCode`, `CFBundleVersion` not `$(FLUTTER_BUILD_NUMBER)`): without a fix, the stamped numbers never reach the app. Propose the fix the note names, and make it only after the human agrees. A note about Codemagic or Bitrise means the app is built outside GitHub Actions and GitLab CI: launchset can't run there, so ask whether the builds move or the apps become manual targets.
98
102
 
99
103
  ## Step 4: Native store pipelines
100
104
 
@@ -135,9 +139,11 @@ The generated workflows have commented examples where the team's build steps go.
135
139
 
136
140
  - Docker: the `docker/build-push-action` settings (`context`, `file`, `platforms`, build args). The tags and labels come from `steps.stamp.outputs.docker-tags` and `docker-labels`.
137
141
  - Android and iOS: Gradle or `xcodebuild`, signing, fastlane. iOS runs on macOS.
142
+ - Flutter: `flutter build appbundle` / `flutter build ipa`, with `--build-name` and `--build-number` from the stamp step (the generated examples show how). Drop the old step's own `--build-number` (a run number, a date): a note names those lines.
138
143
  - Deploys, npm publishing and other steps.
139
144
  - Give every step `if: matrix.target == '<name>' && steps.verify.outputs.already-published != 'true'` in the release workflow.
140
145
  - Custom targets from a GitHub workflow that release tags started: init already copied that job's steps, commented out, under the target's `Build steps missing` step in `launchset-release.yml` (and `launchset-preview.yml`), each with the `if:`. The `actions/checkout` step is left out: launchset's checks out the release commit, so add what the old one set (`lfs: true`, the note says) to it. Uncomment the steps, check them, then remove the guard. Previews run them too.
146
+ - **electron-builder in copied steps.** In CI, electron-builder publishes to GitHub Releases by itself: on tags, and with the GitHub provider on branch pushes too (`onTagOrDraft`). In launchset's release workflow (a push to the base branch) it then fails with "GitHub Personal Access Token is not set", or, with `GH_TOKEN`, uploads to a release of its own next to launchset's. init notes it when a copied step runs electron-builder directly or through a `package.json` script. Pass `--publish never` (in the step, or in the script it runs): launchset creates the GitHub Release. Set `GH_TOKEN` only when the human wants electron-builder to upload the files, and say what that does. init only reads the command line: check the electron-builder config (`build` in `package.json`, `electron-builder.yml` and similar) too, since `publish: null` there already turns publishing off.
141
147
 
142
148
  ### Check the action versions
143
149
 
@@ -185,10 +191,14 @@ For custom targets from tag jobs, init already copied the job's keys into `.laun
185
191
  - **Previews.** Previews run the same steps with `LAUNCHSET_CHANNEL=preview`: publishing steps (an image tagged `latest`, an upload) must only run for `release`, or the target goes out of `preview.targets`.
186
192
  - **After and retries.** A target with `after` gets the other targets' artifacts in the same pipeline only. On a retry that only rebuilds it they are missing: have the other targets also upload their output to a durable place (GitLab's generic package registry; the custom target template shows it) and fetch it from there.
187
193
 
188
- **The "Build steps missing" guard.** For Android, iOS, web and custom targets without npm publishing, the generated workflows contain a step named `Build steps missing (<target>)` that always fails (`exit 1`), so `mark` never records a target that nothing builds. When the team's real build and upload steps for a target are in, **remove that target's guard step**, in both `launchset-release.yml` and `launchset-preview.yml` (on GitLab: the `echo "No build steps for <target> yet..."; exit 1` line in `.launchset-<target>`). Removing a guard without adding steps lets the release complete without building the target: check that every `auto` target has working steps before the PR is merged. Docker targets and npm custom targets have no guard.
194
+ **The "Build steps missing" guard.** For Android, iOS, web and custom targets without npm publishing (on GitLab: custom targets whose job init didn't copy), the generated workflows contain a step named `Build steps missing (<target>)` that always fails (`exit 1`), so `mark` never records a target that nothing builds. When the team's real build and upload steps for a target are in, **remove that target's guard step**, in both `launchset-release.yml` and `launchset-preview.yml` (on GitLab: the `echo "No build steps for <target> yet..."; exit 1` line in `.launchset-<target>`). Removing a guard without adding steps lets the release complete without building the target: check that every `auto` target has working steps before the PR is merged. Docker targets and npm custom targets have no guard.
195
+
196
+ **Previews skip guarded targets.** init writes `preview: { targets: [...] }` without the targets that have a guard (with a comment), so the first `launchset:preview` label doesn't fail on them. `launchset-preview.yml` still has every target's placeholder. When you remove a target's guard in both workflows (with its steps in both), add it back to `preview.targets` (or set `targets: "all"` once none is left), unless its steps must not run for previews (a store upload without a preview track, a deploy).
189
197
 
190
198
  ## Step 7: Open one PR
191
199
 
200
+ Before you open it, make sure the preview label exists: adding a label that doesn't exist fails, `gh pr create --label launchset:preview` included. `gh label list --search launchset:preview`; if it's missing, ask the human, then `gh label create launchset:preview --description "Build a launchset preview"` (init lists this as a step too). On GitLab a label is created when it's first used.
201
+
192
202
  Everything goes in **one PR**. Its description lists:
193
203
 
194
204
  - The decisions and what was chosen (and why, for the ones the human decided).
@@ -197,8 +207,11 @@ Everything goes in **one PR**. Its description lists:
197
207
  - Changes to versions (files that moved to the canonical version) and any lowered version.
198
208
  - The remaining manual steps: create the GitHub App and install it on the repo, add the variable `LAUNCHSET_APP_CLIENT_ID` and the secret `LAUNCHSET_APP_PRIVATE_KEY` (unless the org already has them, or the older secret `LAUNCHSET_APP_ID`; on GitLab: `LAUNCHSET_TOKEN` and `NPM_TOKEN`, protected branches and tags, pipeline variables, `workflow: rules` if init printed them), store credentials (`LAUNCHSET_PLAY_SERVICE_ACCOUNT_JSON`, `LAUNCHSET_ASC_KEY_ID`, `LAUNCHSET_ASC_ISSUER_ID`, `LAUNCHSET_ASC_PRIVATE_KEY`, keystore and signing secrets), and mark the **Changeset check** job as required once it runs (on GitLab: require the MR pipeline to succeed).
199
209
  - That the PR itself needs a changeset: add one (`npx launchset add --bump patch --message "Set up releases with launchset"`, or `--empty`).
210
+ - With a baseline: that the first release workflow run after the merge creates `v<version>`, and that nobody should create or push that tag by hand (and why, naming the tag-triggered workflows it would start).
211
+
212
+ Don't merge it. Merging may start a release if the PR changed the root version of a version without a release tag and without a baseline.
200
213
 
201
- Don't merge it. Merging may start a release if the PR changed the root version of a version without a release tag.
214
+ The order after you hand it over: the human sets up the App (or token) and the secrets, then merges. The first release workflow run on the base branch creates the baseline tag (if any) and opens the first release PR if changesets are pending. If that first run fails because the App isn't set up yet, re-run it once it is: it creates the tag then.
202
215
 
203
216
  ## Repos that also publish npm packages
204
217
 
@@ -18,7 +18,7 @@
18
18
  # Signing secrets (ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS,
19
19
  # ANDROID_KEY_PASSWORD) are CI/CD variables your Gradle config reads.
20
20
  #
21
- # - cd @@android_dir@@
21
+ # - @@cd_android_dir@@
22
22
  # - ./gradlew bundleRelease
23
23
  # - case "$LAUNCHSET_CHANNEL" in release) PLAY_TRACK=production ;; prerelease) PLAY_TRACK=beta ;; *) PLAY_TRACK=internal ;; esac
24
24
  # - export SUPPLY_JSON_KEY_DATA="$LAUNCHSET_PLAY_SERVICE_ACCOUNT_JSON"
@@ -0,0 +1,32 @@
1
+ # --- @@target@@ (android, Flutter): example steps, uncomment and adapt ---
2
+ .launchset-@@target@@:
3
+ # An image with the Android SDK, Java and Node (CircleCI's Android image, the `-node` variant
4
+ # has the current Node LTS). Any image with the SDK, Java and Node 24 or later works: change
5
+ # the tag to pin another release (https://hub.docker.com/r/cimg/android/tags).
6
+ image: cimg/android:@@android_image_tag@@
7
+ @@verify_variables@@
8
+ before_script:
9
+ # The image runs as a non-root user: global npm packages (launchset) go to the home folder.
10
+ - export NPM_CONFIG_PREFIX="$HOME/.npm-global" PATH="$HOME/.npm-global/bin:$PATH"
11
+ # Flutter from its git repository: pin a release with --branch <version> (e.g. 3.38.0).
12
+ # A runner that keeps its home folder between jobs reuses the clone. One with Flutter
13
+ # installed can drop these two lines.
14
+ - test -d "$HOME/flutter" || git clone --depth 1 --branch stable https://github.com/flutter/flutter.git "$HOME/flutter"
15
+ - export PATH="$HOME/flutter/bin:$PATH"
16
+ script:
17
+ # Remove this line once you've added the build and upload steps below: it stops the release
18
+ # from marking @@target@@ as shipped while nothing builds it.
19
+ - echo "No build steps for @@target@@ yet. Add them to .gitlab/launchset-targets.yml and remove this line."; exit 1
20
+ # `stamp` already wrote the version and build number into @@pubspec@@ (`version: X.Y.Z+N`),
21
+ # which Flutter passes to Gradle as versionName and versionCode. The build passes them as
22
+ # --build-name and --build-number too. LAUNCHSET_CHANNEL picks the Google Play track:
23
+ # release -> production, prerelease -> beta, preview -> internal. Signing secrets
24
+ # (ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS, ANDROID_KEY_PASSWORD)
25
+ # are CI/CD variables your Gradle config reads.
26
+ #
27
+ # - @@cd_flutter_dir@@
28
+ # - flutter build appbundle --release --build-name "$LAUNCHSET_VERSION" --build-number "$LAUNCHSET_BUILD_NUMBER"
29
+ # - case "$LAUNCHSET_CHANNEL" in release) PLAY_TRACK=production ;; prerelease) PLAY_TRACK=beta ;; *) PLAY_TRACK=internal ;; esac
30
+ # - export SUPPLY_JSON_KEY_DATA="$LAUNCHSET_PLAY_SERVICE_ACCOUNT_JSON"
31
+ # - cd android # the Gemfile is here, as in Flutter's fastlane guide
32
+ # - bundle exec fastlane supply --aab ../build/app/outputs/bundle/release/app-release.aab --track "$PLAY_TRACK" --package_name "@@package_name@@"
@@ -0,0 +1,42 @@
1
+ # --- @@target@@ (ios, Flutter): example steps, uncomment and adapt ---
2
+ .launchset-@@target@@:
3
+ # A macOS runner. These are GitLab's hosted macOS runners (GitLab.com, Premium and Ultimate):
4
+ # the tag picks the machine (saas-macos-medium-m1 or saas-macos-large-m2pro) and the image the
5
+ # macOS and Xcode version (https://docs.gitlab.com/ci/runners/hosted_runners/macos/). On your
6
+ # own macOS runner, use its tags and drop the image. launchset needs Node 24 or later there:
7
+ # check the image's preinstalled software, else install it first (brew install node@24).
8
+ tags:
9
+ - saas-macos-medium-m1
10
+ image: macos-26-xcode-26
11
+ @@verify_variables@@
12
+ before_script:
13
+ # Flutter from its git repository: pin a release with --branch <version> (e.g. 3.38.0).
14
+ # A runner that keeps its home folder between jobs reuses the clone. One with Flutter
15
+ # installed can drop these two lines.
16
+ - test -d "$HOME/flutter" || git clone --depth 1 --branch stable https://github.com/flutter/flutter.git "$HOME/flutter"
17
+ - export PATH="$HOME/flutter/bin:$PATH"
18
+ script:
19
+ # Remove this line once you've added the build and upload steps below: it stops the release
20
+ # from marking @@target@@ as shipped while nothing builds it.
21
+ - echo "No build steps for @@target@@ yet. Add them to .gitlab/launchset-targets.yml and remove this line."; exit 1
22
+ # `stamp` already wrote the marketing version (plain X.Y.Z) and the build number into
23
+ # @@pubspec@@ (`version: X.Y.Z+N`), which Flutter passes to Xcode as FLUTTER_BUILD_NAME and
24
+ # FLUTTER_BUILD_NUMBER. The build passes them as --build-name and --build-number too.
25
+ # LAUNCHSET_CHANNEL picks where the build goes: release -> TestFlight, ready to submit for
26
+ # App Store review; prerelease -> an external TestFlight group; preview -> internal testers
27
+ # only. Code signing: see "Code signing iOS Projects with fastlane" in the GitLab docs (the
28
+ # runner's keychain isn't usable as is).
29
+ #
30
+ # - @@cd_flutter_dir@@
31
+ # - flutter build ipa --release --export-options-plist=ios/ExportOptions.plist --build-name "$LAUNCHSET_VERSION" --build-number "$LAUNCHSET_BUILD_NUMBER"
32
+ # Upload with a fastlane lane (see "Workflow recipes" in the launchset docs). As in Flutter's
33
+ # fastlane guide, the Gemfile and fastlane/Fastfile are in ios/:
34
+ # lane :testflight do |options|
35
+ # api_key = app_store_connect_api_key(key_id: ENV.fetch("ASC_KEY_ID"),
36
+ # issuer_id: ENV.fetch("ASC_ISSUER_ID"), key_content: ENV.fetch("ASC_PRIVATE_KEY"))
37
+ # upload_to_testflight(api_key: api_key, ipa: options.fetch(:ipa),
38
+ # skip_waiting_for_build_processing: true)
39
+ # end
40
+ # - export ASC_KEY_ID="$LAUNCHSET_ASC_KEY_ID" ASC_ISSUER_ID="$LAUNCHSET_ASC_ISSUER_ID" ASC_PRIVATE_KEY="$LAUNCHSET_ASC_PRIVATE_KEY"
41
+ # - cd ios
42
+ # - bundle exec fastlane testflight ipa:"$(ls ../build/ios/ipa/*.ipa | head -n 1)"
@@ -0,0 +1,51 @@
1
+ # --- @@target@@ (android, Flutter): example steps, uncomment and adapt ---
2
+ # Remove this step once you've added the build and upload steps below: it stops the release
3
+ # from marking @@target@@ as shipped while nothing builds it.
4
+ - name: Build steps missing (@@target@@)
5
+ if: @@if@@
6
+ run: |
7
+ echo "::error::No build steps for @@target@@ yet. Add them to this workflow and remove this step."
8
+ exit 1
9
+ # `stamp` already wrote the version and build number into @@pubspec@@ (`version: X.Y.Z+N`),
10
+ # which Flutter passes to Gradle as versionName and versionCode. The build step passes them as
11
+ # --build-name and --build-number too. `channel` picks the Google Play track:
12
+ # release -> production, prerelease -> beta, preview -> internal.
13
+ # Signing: the release signingConfig in android/app/build.gradle(.kts) reads your upload key,
14
+ # for example from android/key.properties that a step writes from secrets.
15
+ # Secrets are referenced by name only: add them as repository or organization secrets.
16
+ #
17
+ # - name: Set up Java (@@target@@)
18
+ # if: @@if@@
19
+ # uses: actions/setup-java@v6
20
+ # with:
21
+ # distribution: temurin
22
+ # java-version: "17"
23
+ # - name: Set up Flutter (@@target@@)
24
+ # if: @@if@@
25
+ # uses: subosito/flutter-action@v2
26
+ # with:
27
+ # channel: stable
28
+ # cache: true
29
+ # - name: Build the app bundle (@@target@@)
30
+ # if: @@if@@
31
+ # working-directory: @@flutter_dir@@
32
+ # run: flutter build appbundle --release --build-name "$LAUNCHSET_VERSION" --build-number "$LAUNCHSET_BUILD_NUMBER"
33
+ # env:
34
+ # LAUNCHSET_VERSION: ${{ steps.stamp.outputs.marketing-version }}
35
+ # LAUNCHSET_BUILD_NUMBER: ${{ steps.stamp.outputs.build-number }}
36
+ # ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
37
+ # ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
38
+ # ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
39
+ # ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
40
+ # - name: Upload to Google Play (@@target@@)
41
+ # # As in Flutter's fastlane guide, the Gemfile is in @@flutter_native_dir@@.
42
+ # if: @@if@@
43
+ # working-directory: @@flutter_native_dir@@
44
+ # run: |
45
+ # bundle exec fastlane supply \
46
+ # --aab ../build/app/outputs/bundle/release/app-release.aab \
47
+ # --track "$PLAY_TRACK" \
48
+ # --package_name "@@package_name@@"
49
+ # env:
50
+ # PLAY_TRACK: ${{ steps.stamp.outputs.channel == 'release' && 'production' || (steps.stamp.outputs.channel == 'prerelease' && 'beta' || 'internal') }}
51
+ # SUPPLY_JSON_KEY_DATA: ${{ secrets.LAUNCHSET_PLAY_SERVICE_ACCOUNT_JSON }}
@@ -0,0 +1,50 @@
1
+ # --- @@target@@ (ios, Flutter): example steps, uncomment and adapt ---
2
+ # Remove this step once you've added the build and upload steps below: it stops the release
3
+ # from marking @@target@@ as shipped while nothing builds it.
4
+ - name: Build steps missing (@@target@@)
5
+ if: @@if@@
6
+ run: |
7
+ echo "::error::No build steps for @@target@@ yet. Add them to this workflow and remove this step."
8
+ exit 1
9
+ # `stamp` already wrote the marketing version (plain X.Y.Z) and the build number into
10
+ # @@pubspec@@ (`version: X.Y.Z+N`), which Flutter passes to Xcode as FLUTTER_BUILD_NAME and
11
+ # FLUTTER_BUILD_NUMBER. The build step passes them as --build-name and --build-number too.
12
+ # This job runs on a macOS runner. `channel` picks where the build goes: release -> TestFlight,
13
+ # ready to submit for App Store review; prerelease -> an external TestFlight group; preview ->
14
+ # internal testers only.
15
+ # Secrets are referenced by name only: add them as repository or organization secrets.
16
+ #
17
+ # - name: Set up Flutter (@@target@@)
18
+ # if: @@if@@
19
+ # uses: subosito/flutter-action@v2
20
+ # with:
21
+ # channel: stable
22
+ # cache: true
23
+ # - name: Build the IPA (@@target@@)
24
+ # if: @@if@@
25
+ # working-directory: @@flutter_dir@@
26
+ # run: |
27
+ # flutter build ipa --release \
28
+ # --export-options-plist=ios/ExportOptions.plist \
29
+ # --build-name "$LAUNCHSET_VERSION" \
30
+ # --build-number "$LAUNCHSET_BUILD_NUMBER"
31
+ # env:
32
+ # LAUNCHSET_VERSION: ${{ steps.stamp.outputs.marketing-version }}
33
+ # LAUNCHSET_BUILD_NUMBER: ${{ steps.stamp.outputs.build-number }}
34
+ # - name: Upload to TestFlight (@@target@@)
35
+ # # Uses a fastlane lane (see "Workflow recipes" in the launchset docs). As in Flutter's
36
+ # # fastlane guide, the Gemfile and fastlane/Fastfile are in @@flutter_native_dir@@:
37
+ # # lane :testflight do |options|
38
+ # # api_key = app_store_connect_api_key(key_id: ENV.fetch("ASC_KEY_ID"),
39
+ # # issuer_id: ENV.fetch("ASC_ISSUER_ID"), key_content: ENV.fetch("ASC_PRIVATE_KEY"))
40
+ # # upload_to_testflight(api_key: api_key, ipa: options.fetch(:ipa),
41
+ # # skip_waiting_for_build_processing: true)
42
+ # # end
43
+ # if: @@if@@
44
+ # working-directory: @@flutter_native_dir@@
45
+ # run: bundle exec fastlane testflight ipa:"$(ls ../build/ios/ipa/*.ipa | head -n 1)"
46
+ # env:
47
+ # # The raw contents of the .p8 key (also used by `verify`).
48
+ # ASC_KEY_ID: ${{ secrets.LAUNCHSET_ASC_KEY_ID }}
49
+ # ASC_ISSUER_ID: ${{ secrets.LAUNCHSET_ASC_ISSUER_ID }}
50
+ # ASC_PRIVATE_KEY: ${{ secrets.LAUNCHSET_ASC_PRIVATE_KEY }}