Beispiel #1
0
        private static void PushSubTree(PublishData publishData)
        {
            const string origin = "origin";

            var branchName = publishData.pacakge.name;

            try
            {
                Debug.Log(GitHelper.ExecuteCommand($"branch -d {branchName}", Preferences.dryRun));
            }
            catch
            {
                Debug.Log($"Failed to delete previous branch {branchName}");
            }

            var output = GitHelper.ExecuteCommand($"subtree split -P {publishData.path} -b {branchName}", Preferences.dryRun);

            Debug.Log(output);
            Debug.Log(GitHelper.ExecuteCommand($"tag {publishData.pacakge.version} {output.Trim()}", Preferences.dryRun));
            Debug.Log(GitHelper.ExecuteCommand($"push --tags -f -u {origin} {branchName}", Preferences.dryRun));
        }
Beispiel #2
0
        private static void CommitChanges(PublishData publishData)
        {
            if (!Preferences.automaticCommit)
            {
                return;
            }

            Debug.Log("Committing version change.");

            var commitMessage = Preferences.commitmMessage;

            commitMessage = commitMessage.Replace("{PREVIOUS_VERSION}", publishData.version.ToString());
            commitMessage = commitMessage.Replace("{NEW_VERSION}", publishData.newVersion.ToString());

            var gitCommand = $"commit {publishData.pathToJson} -m \"{commitMessage}\"";

            Debug.Log($"Executing: git {gitCommand}");
            if (!Preferences.dryRun)
            {
                GitHelper.ExecuteCommand(gitCommand);
                GitHelper.ExecuteCommand($"tag master-{publishData.version}");
            }
        }