The toolkit uses several dependency managers; each must be updated independently.
In Package.swift, bump the version for each dependency.
Commit both Package.swift and the updated Package.resolved.
In Support/CocoaPods/Specs.swift, update the version for any external .pod(...) dependency, then regenerate:
make podspecscd Sources/Navigator/EPUB/Scripts
pnpm update
make scriptsIn BuildTools/Package.swift, bump the versions, then update the lock:
swift package update --package-path BuildToolsTo bump the minimum required iOS version, update these files:
README.md, section "Minimum Requirements"Package.swiftSupport/CocoaPods/*.podspec– editiosTargetinSupport/CocoaPods/Specs.swift, then runmake podspecsand commit the generated files
A new package is a separately distributable SPM library product. It requires updates to a few places.
Add a new product and its source/test targets:
// products:
.library(name: "Readium<ModuleName>", targets: ["Readium<ModuleName>"]),
// targets:
.target(
name: "Readium<ModuleName>",
dependencies: ["ReadiumShared", "ReadiumNavigator"],
path: "Sources/<ModuleName>"
),
.testTarget(
name: "Readium<ModuleName>Tests",
dependencies: ["Readium<ModuleName>"],
path: "Tests/<ModuleName>Tests"
),Add an entry to Support/CocoaPods/Specs.swift and run make podspecs to generate the podspec file.
Add the new test target to the test plan, otherwise it will not be run by make test. make playground copies this file to Playground/Playground.xctestplan, which is the one referenced by the scheme, hence the container:.. paths relative to the Playground folder:
{
"target" : {
"containerPath" : "container:..",
"identifier" : "Readium<ModuleName>Tests",
"name" : "Readium<ModuleName>Tests"
}
}You are ready to release a new version of the Swift toolkit? Great, follow these steps:
-
Figure out the next version using the semantic versioning scheme. Prerelease versions such as
4.0.0-alpha.1,4.0.0-beta.1or4.0.0-rc.1are supported by the release scripts, but a few steps below behave differently for them. They are flagged with Prerelease. -
Test a migration from the last released version.
- Create a temporary Git tag for
developwith the next version tag (e.g.3.0.1). - Clone the
swift-toolkitfrom the previous version (mainbranch). - Under
TestApp, initialize it with the next toolkit version:make spm version=VERSION lcp=...
- Try to run the Test App, adjusting the integration if needed.
- Delete the Git tag created previously.
- Create a temporary Git tag for
-
Review the list of supported features in
README.md. -
Update the migration guide in case of breaking changes.
-
Prepare the release.
scripts/release-prepare.sh VERSION
This script does the following:
- Creates a branch with the same name as the future tag, from
develop. The podspecs declare:tag => s.versionandpod repo pushlints them by cloning that ref, which does not exist yet at step 7, so the identically-named branch stands in for the tag. - Bumps
versioninSupport/CocoaPods/Specs.swift, then runsmake podspecs. - Bumps the version numbers in
README.md, and checks the "Minimum Requirements" section. - Bumps the version numbers in
TestApp/Sources/Info.plist. - Closes the version in the
CHANGELOG.md, for example. - Updates the localized strings (
make update-locales). - Creates a PR to merge in
develop.
- Creates a branch with the same name as the future tag, from
-
Verify the CI checks pass for the PR. Do not merge it yet.
-
Release the updated Podspecs.
scripts/release-publish-podspecs.sh
The script pushes the podspecs one by one, in dependency order. If one of them fails, it offers to retry and, if you give up, prints the command to resume the sequence where it stopped (
--start N).Warning: all the podspecs must be pushed before merging the PR at step 8.
pod repo pushlints each podspec by cloning:tag => s.version, which resolves to the release branch created at step 5, since the tag does not exist yet. Merging the PR deletes that branch, leaving no ref to clone, and every remaining podspec fails to lint. -
Squash and merge the release PR on GitHub.
-
Tag the new version from
develop.scripts/release-tag.sh
The script fast-forwards
developtoorigin/develop, extracts the version from the last commit message (the squash-merge of the release PR), then creates the annotated tag and pushes it with an explicit refspec, so that the temporary tag from step 2 is never pushed by mistake.It also deletes the local release branch, if it is still around, because it has the same name as the tag and would otherwise make the ref ambiguous. GitHub usually already deleted the remote one on squash-merge.
-
Verify you can fetch the new version from the latest Test App with
make spm|cocoapods version=VERSION -
Announce the release.
-
Create a new release on GitHub.
scripts/release-github.sh
The script creates a draft release pre-filled with documentation links and the formatted changelog. Edit the draft on GitHub to add the "What's Changed" section via "Generate release notes".
Prerelease: the script passes
--prereleasetogh release create, so the release is marked as a prerelease and the last stable release keeps the GitHub "Latest release" badge.Publishing the release triggers the
Documentationworkflow, which builds and deploys the API reference toreadium.org/swift-toolkit/VERSION/.Prerelease: only the versioned folder is generated and deployed. The
latestfolder and the root redirect keep pointing to the API reference of the last stable release. -
Write a high-level summary of the changelog for the blog.
-
Post the blog summary on Discord's
#announcement, with a link to the GitHub release.
-
-
Note: Before merging, verify that SPM and CocoaPods builds succeed against the new tag.
Merge
developintomain.Prerelease: skip this step. Prereleases live on
developonly andmainstays on the stable line, untildevelopis merged for the final release (e.g.4.0.0).