config: build profiles with --profile on ios build and ios share - #19
Closed
Interlap01 wants to merge 9 commits into
Closed
Interlap01 wants to merge 9 commits into
Interlap01 wants to merge 9 commits into
Conversation
A profiles map in builder.json, keyed by name, overrides ios.configuration, ios.scheme, ios.signing and provider, and adds env and the reserved distribution field. ResolveProfile applies the named profile, or defaultProfile, over the top-level settings; with neither the result is the top-level settings unchanged. Unknown names list the available profiles, and env names that are not identifiers or clash with the runner's own parameters are rejected. Signing is a *bool so a profile's false can override a top-level true.
The coordinator resolves the profile, layers --unsigned and --provider on top, and prints the resolved settings before anything is dispatched. Input assembly moves into buildInputs/workflowInputs (GitHub) and inputs (Codemagic/Bitrise) so the mapping is testable. The profile reaches GitHub as one JSON input, profile, sent only when a profile is selected so older workflow files keep working; runner.sh receives BUILD_ENV and DISTRIBUTION variables. The CLI resolves the effective provider first so the GitHub client and signal handling follow a profile that names a provider.
Resolve parameters takes the profile input on dispatch and, on a tag push, the profile named by defaultProfile in builder.json, letting its fields override ios.* (with an explicit null test for signing, since jq's // treats false as missing). The profile's env is written to GITHUB_ENV before the dependency and build steps, and runner.sh exports BUILD_ENV at the start of prepare(). Keys and values are base64 per entry: jq drops NUL bytes, and a key containing a space must not split into a valid name. distribution is validated and exposed as an output for the export step.
…ile env PATH, HOME, DEVELOPER_DIR, the IOS_* signing secrets, MOBAI_API_KEY and the GITHUB_/RUNNER_/ACTIONS_/CM_/FCI_/BITRISE_/BUILDER_ prefixes are rejected alongside the runner parameters: runner.sh exports the profile env before install_signing reads its secrets from the environment. A defaultProfile that names a missing profile now says so instead of reading as a --profile typo.
…input GitHub answers 422 'Unexpected inputs provided' when the committed workflow predates profiles; the error now says to run builder init and push. ios share drops distribution along with configuration and signing, since the simulator job ignores it. Pin the no-profile shape of the runner variables and the share inputs against the pre-profile code.
A value line equal to the fixed __BUILDER_ENV__ delimiter ended the value early and let the rest be read as new variables. A non-object env failed jq inside a process substitution, which set -e cannot see, so nothing was exported and the job carried on; Resolve parameters and runner.sh now fail with a message.
gocritic's hugeParam flags BuildSettings (96 bytes) and BuildOptions (80 bytes) everywhere they are passed by value, and the repo config treats it as an error. Take *config.BuildSettings in the inputs, progress and remote helpers, give EnvJSON/ProfileInput pointer receivers, and have Coordinator.settings hand back a pointer; Build and buildRemote now take *BuildOptions. Both take a copy before filling in their defaults, so the caller's BuildOptions is left exactly as it was passed.
6 tasks
Collaborator
Author
|
Folded into #23, which carries these commits with the final profile design. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Build profiles in
builder.json, modeled oneas.json:builder ios build --profile <name>andbuilder ios share --profile <name>select a profile;defaultProfileapplies when no flag is given. Without either, dispatch inputs and Codemagic/Bitrise parameters are identical to before, pinned by tests.configuration,scheme,signing,provider,env,distribution);--unsignedand--providerstill win. Unknown names error with the available list. Resolved settings are printed before dispatch.envreaches the runner as one JSON workflow inputprofile, keepingios-build.ymlunder GitHub's ten-input cap with room for the upcoming build number.Resolve parameterswrites it to$GITHUB_ENVwith a random heredoc delimiter before any dependency or build step; tag-triggered runs readdefaultProfilefrombuilder.json. Codemagic/Bitrise receiveBUILD_ENVandDISTRIBUTION, exported byrunner.shinprepare().PATH/HOME/DEVELOPER_DIR,MOBAI_API_KEYand theGITHUB_/RUNNER_/CM_/BITRISE_/BUILDER_namespaces are reserved. Env values are build configuration, not secrets: they appear in run inputs and logs, and the README says so.distributionis validated and passed through assteps.params.outputs.distribution/$DISTRIBUTIONfor the export step to consume in a follow-up.builder initmust be re-run and the workflow committed.Test plan
go build ./... && go vet ./... && go test ./...,gofmt -l .cleanbuilder ios buildwithout a profile on an existing project: same inputs and behavior as beforebuilder ios build --profile previewafterbuilder init: run log shows the env exported andReleasebuilder ios build --profile nopelists the available profilesdefaultProfileset picks it up