Skip to content

Commit 2ca39dd

Browse files
committed
(GH-16) Add ability to upload an asset
- Added new method to upload an asset to a given milestone release - This relies on the TagName being the same as the milestone - can't really enforce this, but it is assumed to be part of process - Created folder for all Options
1 parent 5c1b3d4 commit 2ca39dd

13 files changed

+94
-27
lines changed

Source/GitHubReleaseManager.Cli/GitHubReleaseManager.Cli.csproj

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,18 @@
7575
</ItemGroup>
7676
<ItemGroup>
7777
<Compile Include="AssemblyInfo.cs" />
78-
<Compile Include="BaseGitHubSubConfig.cs" />
79-
<Compile Include="BaseSubOptions.cs" />
80-
<Compile Include="CloseSubOptions.cs" />
81-
<Compile Include="CommonSubOptions.cs" />
82-
<Compile Include="CreateSubOptions.cs" />
83-
<Compile Include="ExportSubOptions.cs" />
84-
<Compile Include="InitSubOptions.cs" />
85-
<Compile Include="Options.cs" />
78+
<Compile Include="Options\AddAssetSubOptions.cs" />
79+
<Compile Include="Options\BaseGitHubSubOptions.cs" />
80+
<Compile Include="Options\BaseSubOptions.cs" />
81+
<Compile Include="Options\CloseSubOptions.cs" />
82+
<Compile Include="Options\CommonSubOptions.cs" />
83+
<Compile Include="Options\CreateSubOptions.cs" />
84+
<Compile Include="Options\ExportSubOptions.cs" />
85+
<Compile Include="Options\InitSubOptions.cs" />
86+
<Compile Include="Options\MainOptions.cs" />
8687
<Compile Include="Program.cs" />
87-
<Compile Include="PublishSubOptions.cs" />
88-
<Compile Include="ShowConfigSubOptions.cs" />
88+
<Compile Include="Options\PublishSubOptions.cs" />
89+
<Compile Include="Options\ShowConfigSubOptions.cs" />
8990
</ItemGroup>
9091
<ItemGroup>
9192
<None Include="app.config" />
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright file="AddAssetSubOptions.cs" company="gep13">
3+
// Copyright (c) gep13. All rights reserved.
4+
// </copyright>
5+
//-----------------------------------------------------------------------
6+
7+
namespace GitHubReleaseManager.Cli.Options
8+
{
9+
using CommandLine;
10+
11+
public class AddAssetSubOptions : CommonSubOptions
12+
{
13+
[Option('a', "asset", HelpText = "Path to the file to include in the release.", Required = true)]
14+
public string AssetPath { get; set; }
15+
}
16+
}

Source/GitHubReleaseManager.Cli/BaseGitHubSubConfig.cs renamed to Source/GitHubReleaseManager.Cli/Options/BaseGitHubSubOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
// <copyright file="BaseGitHubSubConfig.cs" company="gep13">
1+
// <copyright file="BaseGitHubSubOptions.cs" company="gep13">
22
// Copyright (c) gep13. All rights reserved.
33
// </copyright>
44
//-----------------------------------------------------------------------
55

6-
namespace GitHubReleaseManager.Cli
6+
namespace GitHubReleaseManager.Cli.Options
77
{
88
using CommandLine;
99
using Octokit;
1010

11-
public abstract class BaseGitHubSubConfig : BaseSubOptions
11+
public abstract class BaseGitHubSubOptions : BaseSubOptions
1212
{
1313
[Option('u', "username", HelpText = "The username to access GitHub with.", Required = true)]
1414
public string UserName { get; set; }

Source/GitHubReleaseManager.Cli/BaseSubOptions.cs renamed to Source/GitHubReleaseManager.Cli/Options/BaseSubOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// </copyright>
55
//-----------------------------------------------------------------------
66

7-
namespace GitHubReleaseManager.Cli
7+
namespace GitHubReleaseManager.Cli.Options
88
{
99
using CommandLine;
1010

Source/GitHubReleaseManager.Cli/CloseSubOptions.cs renamed to Source/GitHubReleaseManager.Cli/Options/CloseSubOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// </copyright>
55
//-----------------------------------------------------------------------
66

7-
namespace GitHubReleaseManager.Cli
7+
namespace GitHubReleaseManager.Cli.Options
88
{
99
public class CloseSubOptions : CommonSubOptions
1010
{

Source/GitHubReleaseManager.Cli/CommonSubOptions.cs renamed to Source/GitHubReleaseManager.Cli/Options/CommonSubOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
// </copyright>
55
//-----------------------------------------------------------------------
66

7-
namespace GitHubReleaseManager.Cli
7+
namespace GitHubReleaseManager.Cli.Options
88
{
99
using CommandLine;
1010

11-
public abstract class CommonSubOptions : BaseGitHubSubConfig
11+
public abstract class CommonSubOptions : BaseGitHubSubOptions
1212
{
1313
[Option('m', "milestone", HelpText = "The milestone to use.", Required = true)]
1414
public string Milestone { get; set; }

Source/GitHubReleaseManager.Cli/CreateSubOptions.cs renamed to Source/GitHubReleaseManager.Cli/Options/CreateSubOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// </copyright>
55
//-----------------------------------------------------------------------
66

7-
namespace GitHubReleaseManager.Cli
7+
namespace GitHubReleaseManager.Cli.Options
88
{
99
using CommandLine;
1010

Source/GitHubReleaseManager.Cli/ExportSubOptions.cs renamed to Source/GitHubReleaseManager.Cli/Options/ExportSubOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
// </copyright>
55
//-----------------------------------------------------------------------
66

7-
namespace GitHubReleaseManager.Cli
7+
namespace GitHubReleaseManager.Cli.Options
88
{
99
using CommandLine;
1010

11-
public class ExportSubOptions : BaseGitHubSubConfig
11+
public class ExportSubOptions : BaseGitHubSubOptions
1212
{
1313
[Option('f', "fileOutputPath", HelpText = "Path to the file export releases.", Required = true)]
1414
public string FileOutputPath { get; set; }

Source/GitHubReleaseManager.Cli/InitSubOptions.cs renamed to Source/GitHubReleaseManager.Cli/Options/InitSubOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// </copyright>
55
//-----------------------------------------------------------------------
66

7-
namespace GitHubReleaseManager.Cli
7+
namespace GitHubReleaseManager.Cli.Options
88
{
99
public class InitSubOptions : BaseSubOptions
1010
{

Source/GitHubReleaseManager.Cli/Options.cs renamed to Source/GitHubReleaseManager.Cli/Options/MainOptions.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
//-----------------------------------------------------------------------
2-
// <copyright file="Options.cs" company="gep13">
2+
// <copyright file="MainOptions.cs" company="gep13">
33
// Copyright (c) gep13. All rights reserved.
44
// </copyright>
55
//-----------------------------------------------------------------------
66

7-
namespace GitHubReleaseManager.Cli
7+
namespace GitHubReleaseManager.Cli.Options
88
{
99
using CommandLine;
1010
using CommandLine.Text;
1111

12-
public class Options
12+
public class MainOptions
1313
{
1414
[VerbOption("create", HelpText = "Creates a draft release notes from a milestone.")]
1515
public CreateSubOptions CreateVerb { get; set; }
1616

17+
[VerbOption("addasset", HelpText = "Adds an asset to an existing release.")]
18+
public AddAssetSubOptions AddAssetVerb { get; set; }
19+
1720
[VerbOption("close", HelpText = "Closes the milestone.")]
1821
public CloseSubOptions CloseVerb { get; set; }
1922

0 commit comments

Comments
 (0)