Go to file
Franco Meloni d05a60493b
Merge pull request #3 from f-meloni/swift_scripts
Swift scripts support
2018-12-05 17:29:28 +00:00
Sources Added swift scripts support 2018-12-04 16:54:56 +00:00
Tests Update Linux tests 2018-12-04 16:56:30 +00:00
.gitignore Initial commit 2018-11-29 14:09:10 +00:00
.rocket.yml Tag the correct commit 2018-12-03 13:52:59 +00:00
.swift-version Added swift-version file 2018-12-03 12:48:46 +00:00
.travis.yml Setup travis 2018-12-03 12:46:23 +00:00
Package.resolved Add Komondor to the project 2018-12-03 11:04:57 +00:00
Package.swift Unhide dev dependencies 2018-12-03 19:06:02 +00:00
README.md Update README.md 2018-12-03 11:34:05 +00:00

README.md

Rocket 🚀

Swift CLI release tool for Git repos and Swift Packages

Installation

You can install Rocket with SPM

  1. Add or amend a Package.swift
  2. Add this dependency .package(url: "https://github.com/f-meloni/Rocket", from: "0.1.0")
  3. Then you can just run swift run rocket 1.0.0 where 1.0.0 is the version that you want to release

Setup the release steps

With YAML

Create a file called .rocket.yml with your steps inside

---
steps: 
  - script: 
      content: ruby Scripts/update_changelog.rb
  - git_add:
      paths:
        - CHANGELOG.md
  - commit:
      message: "Releasing version $VERSION"
  - tag
  - push

With PackageConfig

With PackageConfig (https://github.com/orta/PackageConfig) you can just put the configuration at the end of your Package.swift

#if canImport(PackageConfig)
    import PackageConfig
    
    let config = PackageConfig([
        "rocket": ["steps":
            [
                ["script": ["content": "ruby Scripts/update_changelog.rb"]]
                ["git_add": ["paths": ["CHANGELOG.md"]]],
                ["commit": ["message": "Releasing version $VERSION"]],
                "tag",
                "push"
            ]
        ]
    ])

Supported Steps

script

Runs a command line script

Parameters:

content: String (required): the script content

git_add

Adds the files to the git's staging area

Parameters:

paths: [String] (optional): The paths you want to add to the staging area - default: [.]

commit

Commits on git

Parameters:

message: String (optional): The commit message - default: "Version $VERSION"

no_verify: Bool (optional): bypasses the pre-commit and commit-msg hooks default: false

tag

Tags the current version

push

Pushes the current changes

Parameters:

remote: String (optional): The name of the remote you want to push to - default: "origin"

branch: String (optional): The name of the branch you want to push - default: "master"

hide_dev_dependencies

Comment the dev dependencies on your Package.swift to avoid them to be shipped with your release

Parameters:

package_path: String (optional): The relative path to your Package.swift file - default: "Package.swift"

unhide_dev_dependencies

Uncomment the dev dependencies on your Package.swift after you released.

Parameters:

package_path: String (optional): The relative path to your Package.swift file - default: "Package.swift"

Variable $VERSION

You can use the variable $VERSION inside the steps to refer to the version you are releasing

Next steps

  • Show the scripts output on the stdout
  • Add a step to execute script files written in swift
  • Add a step to execute ruby code
  • Add a step to comment the dev dependencies on the Package.swift
  • Add a step to create Github releases