Skip to content

Commit

Permalink
Convert CLI to dotnet tool (#36)
Browse files Browse the repository at this point in the history
* Convert CLI to dotnet tool

This converts the CLI into a dotnet tool (https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install) so that it can be installed via `dotnet tool install` rather than downloading binaries off of github.

BREAKING CHANGE: The assembly name of the compiled output was changed from `sq` to `Squidex.CLI` to comply with nuget standards.

* Allow sq assembly name for all but nuget tool build

For the dotnet tool build packing it means we also have to specify

    dotnet pack -p:PackDotnetTool=1 ...

* Publish cli dotnet tool on build
  • Loading branch information
freakingawesome authored and SebastianStehle committed Dec 13, 2019
1 parent 1a436fc commit cf95b4f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ jobs:
cd cli/Squidex.CLI/Squidex.CLI
dotnet publish -r osx-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true
- name: pack dotnet tool
run: |
cd cli/Squidex.CLI/Squidex.CLI
dotnet pack -p:PackDotnetTool=1 -c Release
- name: push dotnet tool to nuget.org
run: |
cd cli/Squidex.CLI/Squidex.CLI/bin/Release
dotnet nuget push *.nupkg --source 'https://api.nuget.org/v3/index.json' -k ${{ secrets.nuget }}
- name: create dir
run: |
mkdir cli/Squidex.CLI/Squidex.CLI/bin/Release/out
Expand Down
12 changes: 11 additions & 1 deletion cli/Squidex.CLI/Squidex.CLI/Squidex.CLI.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AssemblyName>sq</AssemblyName>
<AssemblyName Condition="'$(PackDotnetTool)'!='1'">sq</AssemblyName>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<Version>4.0</Version>
<PackAsTool>true</PackAsTool>
<ToolCommandName>sq</ToolCommandName>
<Authors>sebastianstehle</Authors>
<Company>Squidex UG (haftungsbeschränkt)</Company>
<Description>Command Line Interface for Squidex Headless CMS</Description>
<Copyright>MIT</Copyright>
<PackageTags>Squidex HeadlessCMS</PackageTags>
<PackageIconUrl>https://raw.githubusercontent.com/Squidex/squidex/master/media/logo-squared.png</PackageIconUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Squidex/squidex/</PackageProjectUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ConsoleTables" Version="2.3.0" />
Expand Down

0 comments on commit cf95b4f

Please sign in to comment.