Skip to content

Commit 5948c53

Browse files
heckjbripeticca
andauthored
migrates documentation/continuousintegration.md (#8760)
### Motivation: migrates content from documentation/continuousintegration.md ### Modifications: - convert to DocC format - minor wording and format adjustments resolves #8587 --------- Co-authored-by: Bri Peticca <briannap_22@apple.com>
1 parent 7c5b0bc commit 5948c53

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Continuous Integration Workflows
2+
3+
Build Swift packages with an existing continuous integration setup and prepare apps that consume package dependencies within an existing CI pipeline.
4+
5+
## Overview
6+
7+
*Continuous integration* (*CI*) is the process of automating and streamlining the building, analyzing, testing, archiving, and publishing of your apps to ensure that they're always in a releasable state.
8+
Most projects that contain or depend on Swift packages don't require additional configuration.
9+
10+
## Use the Expected Version of a Package Dependency
11+
12+
To ensure a CI workflow’s reliability, verify it uses the appropriate version of package dependencies.
13+
SwiftPM records the result of dependency resolution in the file `Package.resolved`, at the top-level of the package.
14+
When available, it's used when performing dependency resolution.
15+
16+
Run <doc:PackageUpdate> to update dependencies to the latest eligible versions and update `Package.resolved`.
17+
For more information on resolving and updating dependencies, see <doc:ResolvingPackageVersions>.
18+
19+
20+
## Provide Credentials
21+
22+
To resolve package dependencies that require authentication, such as private packages, provide credentials to your CI setup.
23+
Package manager honors the machine's SSH configuration - there's no additional setup required.
24+
For private package, use the SSH-based Git URLs and configure SSH credentials.
25+
You may also need to set up a `known_hosts` file in the `~/.ssh` directory of the user that runs your CI tasks.
26+
27+
CI services like [Jenkins](https://www.jenkins.io/doc/book/using/using-credentials), [Github Action](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow), [TravisCI](https://docs.travis-ci.com/user/private-dependencies), and [CircleCI](https://circleci.com/docs/2.0/gh-bb-integration/#security) provide ways to set up SSH keys or other techniques to access private repositories.
28+
Since Package manager uses git to clone the repositories there's no additional setup required; Package manager honors the machine's SSH and Git configuration.
29+
30+
## Using xcodebuild
31+
32+
When building on macOS based CI hosts you can use the command-line tool `xcodebuild`.
33+
`xcodebuild` uses Xcode's built-in Git tooling to connect to repositories.
34+
35+
In many cases, you don't need to make changes to how xcodebuild connects to them.
36+
However, some use cases require you use the git configuration — for example URL remapping, the use of proxies, or advanced SSH configurations.
37+
To have xcodebuild use your Mac's Git installation and configuration instead of Xcode's built-in Git tooling, pass `-scmProvider system` to the xcodebuild command.
38+
39+
For more information on using xcodebuild in continuous integration workflows, visit [Building Swift packages or apps that use them in continuous integration workflows](https://developer.apple.com/documentation/swift_packages/building_swift_packages_or_apps_that_use_them_in_continuous_integration_workflows).

Sources/PackageManagerDocs/Documentation.docc/Documentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The Swift Package Manager lets you share your code as a package, depend on and u
2929
- <doc:SwiftVersionSpecificPackaging>
3030
- <doc:BundlingResources>
3131
- <doc:ReleasingPublishingAPackage>
32+
- <doc:ContinuousIntegration>
3233
- <doc:UsingShellCompletion>
3334
- <doc:SwiftPMAsALibrary>
3435
- <doc:ModuleAliasing>

0 commit comments

Comments
 (0)