Swift Package Scripts let you easily build and test your Swift Package, generate DocC documentation and XCFrameworks, and create new versions.
The scripts
filder contains the following scripts:
build.sh
- Run builds for all provided platforms.chmod.sh
- Runschmod +x
on all scripts in the script folder.docc.sh
- Build DocC documentation for all provided platforms.framework.sh
- Build an XCFramework for all provided platforms.git_default_branch.sh
- Get the default git branch name.package_docc.sh
- Build DocC documentation for the main Swift package.package_framework.sh
- Build an XCFramework for the main Swift package.package_name.sh
- Get the name of the main Swift package.package_version.sh
- Create a new version for the main Swift package.sync_from.sh
- Sync the scripts folder from a Swift Package Scripts folder.test.sh
- Run the project unit tests for all provided platforms.version.sh
- Create a new version with validation and test steps.version_bump.sh
- Bump the version number and push a new version tag.version_number.sh
- Get the current git version number.version_validate_git.sh
- Validate that a git repo is ready for release.version_validate_target.sh
- Validate that a target is ready for release.
Note that you may have to run chmod +x <SCRIPT>
to be able to run a script.
Swift Package Scripts can be installed to your computer by cloning the repository:
git clone https://github.com/danielsaidi/SwiftPackageScripts.git
You can then navigate to the folder and sync the scripts to any older folder on your machine.
The sync_to.sh
script can be used to sync the entire scripts
folder to another folder:
./sync_to.sh ../MyOtherProject
This will remove any already existing folder, and replace it with the latest version.
You can also run scripts/sync_from.sh
from another folder, to update its scripts folder:
./scripst/sync_from.sh ../SwiftPackageScripts
This means that you can easily keep your projects in sync with your local copy of this project.
The .github/workflows
folder contains build
and docc
runner files that are used to run tests and build DocC documentation with GitHub Actions on every push to the main branch.
These GitHub scripts are not part of the sync. You can manually copy them to your own project to integrate these scripts with GitHub Actions.
This repository has a sample package that is used to test that everything works as expected.
For more information about these scripts, and how to set up project-specific scripts, see the online here.
You can sponsor me on GitHub Sponsors or reach out for paid support, to help support my open-source projects.
Your support makes it possible for me to put more work into these projects and make them the best they can be.
Feel free to reach out if you have questions or if you want to contribute in any way:
- Website: danielsaidi.com
- Mastodon: @danielsaidi@mastodon.social
- Twitter: @danielsaidi
- E-mail: daniel.saidi@gmail.com
SystemNotification is available under the MIT license. See the LICENSE file for more info.