Skip to content

Commit cb5cce6

Browse files
authored
add dotnet tool (#220)
* #216 - improve build props * fix * #216 - add icon * #216 - add tool setup * #216 - release update * fix * #216 - stronger condition
1 parent b1872cb commit cb5cce6

File tree

4 files changed

+57
-9
lines changed

4 files changed

+57
-9
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
permissions:
99
contents: write
1010
issues: write
11+
actions: write
1112

1213
jobs:
1314
create-release:
@@ -85,6 +86,8 @@ jobs:
8586
name: Publish release
8687
runs-on: ubuntu-latest
8788
needs: upload-release-assets
89+
outputs:
90+
determined_version: ${{ needs.upload-release-assets.outputs.determined_version }}
8891
steps:
8992
- name: Setup .NET
9093
uses: actions/setup-dotnet@v5
@@ -103,4 +106,24 @@ jobs:
103106
with:
104107
token: ${{ secrets.GITHUB_TOKEN }}
105108
repository: 'Stepami/hydrascript'
106-
milestone: ${{ needs.upload-release-assets.outputs.determined_version }}
109+
milestone: ${{ needs.upload-release-assets.outputs.determined_version }}
110+
111+
publish-nuget:
112+
name: Publish as dotnet tool to NuGet
113+
runs-on: ubuntu-latest
114+
needs: publish-release
115+
steps:
116+
- name: Checkout
117+
uses: actions/checkout@v5
118+
- name: Setup .NET
119+
uses: actions/setup-dotnet@v5
120+
with:
121+
dotnet-version: 10.0.x
122+
- name: Build
123+
run: dotnet build ./src/HydraScript/HydraScript.csproj -c Release -v n \
124+
/p:Version=${{ needs.publish-release.outputs.determined_version }} \
125+
/p:PublishAot=false /p:PublishSingleFile=false
126+
- name: Publish
127+
run: dotnet nuget push ./src/HydraScript/bin/Release/*.nupkg \
128+
--api-key ${{ secrets.NUGET_API_KEY }} \
129+
--source https://api.nuget.org/v3/index.json

Directory.Build.props

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
88
<LangVersion>latest</LangVersion>
99
<BuildInParallel>false</BuildInParallel>
10+
<IsPackable>false</IsPackable>
1011
</PropertyGroup>
1112

12-
<PropertyGroup Condition="'$(Configuration)'=='Release'">
13+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
1314
<DebugType>none</DebugType>
1415
<DebugSymbols>false</DebugSymbols>
16+
<OptimizationPreference>Size</OptimizationPreference>
17+
<InvariantGlobalization>true</InvariantGlobalization>
18+
<StackTraceSupport>false</StackTraceSupport>
19+
<UseSystemResourceKeys>true</UseSystemResourceKeys>
1520
</PropertyGroup>
1621

1722
<PropertyGroup>

icon.png

35.2 KB
Loading

src/HydraScript/HydraScript.csproj

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
<PublishSingleFile>true</PublishSingleFile>
77
</PropertyGroup>
88

9-
<PropertyGroup Condition="'$(Configuration)'=='Release'">
10-
<OptimizationPreference>Size</OptimizationPreference>
11-
<InvariantGlobalization>true</InvariantGlobalization>
12-
<StackTraceSupport>false</StackTraceSupport>
13-
<UseSystemResourceKeys>true</UseSystemResourceKeys>
14-
</PropertyGroup>
15-
169
<ItemGroup>
1710
<ProjectReference Include="..\Infrastructure\HydraScript.Infrastructure.LexerRegexGenerator\HydraScript.Infrastructure.LexerRegexGenerator.csproj"
1811
OutputItemType="Analyzer"
@@ -25,4 +18,31 @@
2518
<PackageReference Include="System.CommandLine" />
2619
</ItemGroup>
2720

21+
<PropertyGroup Condition="'$(PublishAot)' == 'false' And '$(PublishSingleFile)' == 'false'">
22+
<IsPackable>true</IsPackable>
23+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
24+
<PackageId>HydraScript</PackageId>
25+
<Description>TypeScript &amp; Go inspired small interpreted programming language written in C#</Description>
26+
<Authors>Stepami</Authors>
27+
<Company>N/A</Company>
28+
<Copyright>Copyright © Stepami 2025</Copyright>
29+
<RepositoryUrl>https://github.com/Stepami/hydrascript</RepositoryUrl>
30+
<RepositoryType>git</RepositoryType>
31+
<PackageProjectUrl>https://github.com/Stepami/hydrascript</PackageProjectUrl>
32+
<Title>HydraScript</Title>
33+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
34+
<PackageTags>interpreter script scripting cgi json backend bash perl typescript go csharp</PackageTags>
35+
<PackAsTool>true</PackAsTool>
36+
<ToolCommandName>hydrascript</ToolCommandName>
37+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
38+
<PackageReadmeFile>README.md</PackageReadmeFile>
39+
<PackageIcon>icon.png</PackageIcon>
40+
</PropertyGroup>
41+
42+
<ItemGroup Condition="'$(PublishAot)' == 'false' And '$(PublishSingleFile)' == 'false'">
43+
<None Include="../../LICENSE" Pack="true" Visible="false" PackagePath=""/>
44+
<None Include="../../README.md" Pack="true" Visible="false" PackagePath=""/>
45+
<None Include="../../icon.png" Pack="true" Visible="false" PackagePath=""/>
46+
</ItemGroup>
47+
2848
</Project>

0 commit comments

Comments
 (0)