コード例 #1
0
 public override bool Execute()
 {
     var client = new GitHubClient(new ProductHeaderValue("GitTfsTasks"), CredentialStore).Release;
     var release = client.CreateRelease(Owner, RepositoryName, BuildReleaseData()).Result;
     IdRelease = release.Id;
     Log.LogMessage("Created Release {0} at {1}", release.TagName, release.HtmlUrl);
     if (Files != null && Files.Length != 0)
     {
         UploadedAssets = UploadAll(client, release, Files);
         foreach (var item in UploadedAssets) Log.LogMessage("Uploaded {0}", item.ItemSpec);
     }
     return true;
 }
コード例 #2
0
ファイル: GitHubWrapper.cs プロジェクト: pmiossec/Buildcs
		public bool Release(string repository, string oauthToken, string tagName, UploadFile[] files, string releaseNotesFile = null)
		{
			_repository = repository;
			_oauthToken = oauthToken;
			_tagName = tagName;
			_releaseNotesFile = releaseNotesFile;

			var client = new GitHubClient(new Octokit.ProductHeaderValue("GitTfsTasks"), CredentialStore).Release;
			var release = client.CreateRelease(Owner, RepositoryName, BuildReleaseData()).Result;
			IdRelease = release.Id;
			//BuildHelper.DisplayAndLog(string.Format("Created Release {0} at {1}", release.TagName, release.HtmlUrl));
			if (files != null && files.Length != 0)
			{
				UploadedAssets = UploadAll(client, release, files);
				//foreach (var item in UploadedAssets) BuildHelper.DisplayAndLog(string.Format("Uploaded {0}", item));
			}

			return true;
		}