https://github.com/danielsaidi/swiftpackagescripts
A collection of Swift Package-related shell scripts.
https://github.com/danielsaidi/swiftpackagescripts
shell swift swiftpackage swiftpackagemanager terminal
Last synced: about 2 months ago
JSON representation
A collection of Swift Package-related shell scripts.
- Host: GitHub
- URL: https://github.com/danielsaidi/swiftpackagescripts
- Owner: danielsaidi
- License: mit
- Created: 2024-10-03T22:54:40.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-11T11:20:29.000Z (2 months ago)
- Last Synced: 2025-09-18T01:00:04.417Z (about 2 months ago)
- Topics: shell, swift, swiftpackage, swiftpackagemanager, terminal
- Language: Shell
- Homepage: https://danielsaidi.com/opensource
- Size: 2.52 MB
- Stars: 73
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Swift Package Scripts
Swift Package Scripts has Terminal scripts that can build and test your Swift Package, build DocC documentation and deploy it to GitHub Pages, generate XCFramework zip files, and create new semantic versions.
## Scripts
The `scripts` folder contains the following scripts:
* `build.sh` - Build a target for all or some platforms.
* `chmod.sh` - Runs `chmod +x` on all scripts in the script folder.
* `docc.sh` - Build DocC documentation for all or some platforms.
* `framework.sh` - Build an XCFramework for all or some platforms.
* `git_default_branch.sh` - Get the default git branch name.
* `package_name.sh` - Get the name of the main Swift package.
* `release.sh` - Make a release build with several validation steps.
* `sync_from.sh` - Sync `scripts` from a Swift Package Scripts folder.
* `test.sh` - Test a target on all or some platforms.
* `validate_git_branch.sh` - Validate the current branch.
* `validate_release.sh` - Validate the package for release.
* `version_bump.sh` - Bump the current version number and create a new tag.
* `version_number.sh` - Get the current version number from the latest tag.
Note that you have to run `chmod +x ` to be able to run a script for the first time. You can use `chmod.sh` to do this for all `scripts`.
## GitHub Actions
The `.github` folder contains the following GitHub Actions workflows:
* `build.yml` - Build the package for all or some platforms.
* `docc.yml` - Build DocC documentation and deploy it to GitHub Pages.
* `test.yml` - Test the package on all or some platforms.
These workflows use `main` as git branch. Change this in each file to trigger the workflows for other branches. As the files are not part of the sync, you have to copy them manually.
## 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, using the `scripts/sync_to.sh` script.
```shell
./sync_to.sh ../AnotherProjectFolder
```
This will remove any already existing folder, and replace it with the latest version. After the first sync, you can use `scripts/sync_from.sh` in the project folder to sync from another folder.
## Support My Work
You can [become a sponsor][Sponsors] to help me dedicate more time on my various [open-source tools][OpenSource]. Every contribution, no matter the size, makes a real difference in keeping these tools free and actively developed.
## 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][Documentation].
## Contact
Feel free to reach out if you have questions or if you want to contribute in any way:
* Website: [danielsaidi.com][Website]
* Mastodon: [@danielsaidi@mastodon.social][Mastodon]
* Twitter: [@danielsaidi][Twitter]
* E-mail: [daniel.saidi@gmail.com][Email]
## License
Swift Package Scripts is available under the MIT license. See the [LICENSE][License] file for more info.
[Email]: mailto:daniel.saidi@gmail.com
[Website]: https://www.danielsaidi.com
[GitHub]: https://www.github.com/danielsaidi
[Twitter]: https://www.twitter.com/danielsaidi
[Mastodon]: https://mastodon.social/@danielsaidi
[Sponsors]: https://github.com/sponsors/danielsaidi
[OpenSource]: https://www.danielsaidi.com/opensource
[Documentation]: https://danielsaidi.github.io/SwiftPackageScripts/
[License]: https://github.com/danielsaidi/SystemNotification/blob/master/LICENSE