Skip to content

danielsaidi/SwiftPackageScripts

Repository files navigation

Project Icon

Version Swift 6.0 Documentation MIT License Sponsor my work

Swift Package Scripts

Swift Package Scripts has scripts that let you build and test your Swift Package, generate DocC documentation & XCFrameworks, and create new versions.

Scripts

The scripts filder contains the following scripts:

  • build.sh - Run builds for all provided platforms.
  • chmod.sh - Runs chmod +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.

Installation

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.

Support My Work

You can become a sponsor to help me dedicate more time on my various open-source tools. Every contribution, no matter the size, makes a real difference in keeping these tools free and actively developed.

Sync scripts

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.

GitHub integrations

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.

Sample Package

This repository has a sample package that is used to test that everything works as expected.

Documentation

For more information about these scripts, and how to set up project-specific scripts, see the online here.

Contact

Feel free to reach out if you have questions or if you want to contribute in any way:

License

SystemNotification is available under the MIT license. See the LICENSE file for more info.

About

A collection of handy build & test scripts for Swift Packages.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project