Skip to content

Commit

Permalink
创建push_nuget action
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvelTiter committed Jul 28, 2024
1 parent 2a399b5 commit babd6a9
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/push_nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: publish

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
run: |
dotnet build ./src -c Release
- name: Pack
run: |
dotnet pack ./src/AutoInjectGenerator/AutoInjectGenerator.csproj -c Release -o publish/autoinject
- name: Push
run: |
dotnet nuget push 'publish/autoinject/*.nupkg' -s https://api.nuget.org/v3/index.json -k ${{secrets.AUTOINJECT}} --skip-duplicate
- name: Pack
run: |
dotnet pack ./src/AutoWasmApiGenerator/AutoWasmApiGenerator.csproj -c Release -o publish/autowasmapi
- name: Push
run: |
dotnet nuget push 'publish/autowasmapi/*.nupkg' -s https://api.nuget.org/v3/index.json -k ${{secrets.AUTOWASMAPI}} --skip-duplicate
6 changes: 6 additions & 0 deletions src/AutoInjectGenerator/AutoInjectGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>MarvelTiter</Authors>
<Version>0.0.1</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<!-- Package the generator in the analyzer directory of the nuget package -->
<None Include="..\AutoInject.Roslyn\bin\$(Configuration)\netstandard2.0\AutoInject.Roslyn.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
<None Include=".\readme.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions src/AutoInjectGenerator/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
`AutoInjectAttribute`

`AutoInjectContextAttribute`

`AutoInjectConfiguration`
6 changes: 6 additions & 0 deletions src/AutoWasmApiGenerator/AutoWasmApiGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>MarvelTiter</Authors>
<Version>0.0.1</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework) == 'netstandard2.0'">
Expand All @@ -20,5 +22,9 @@
<!-- Package the generator in the analyzer directory of the nuget package -->
<None Include="..\AutoWasmApi.Roslyn\bin\$(Configuration)\netstandard2.0\AutoWasmApi.Roslyn.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
<None Include=".\readme.md" Pack="true" PackagePath="\"/>
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions src/AutoWasmApiGenerator/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
`WebControllerAttribute`

`ApiInvokerGeneraAttribute`

`WebMethodAttribute`
4 changes: 2 additions & 2 deletions src/MT.Generators.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AutoWasm", "AutoWasm", "{0D
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoWasmApi.Roslyn", "AutoWasmApi.Roslyn\AutoWasmApi.Roslyn.csproj", "{625157FF-90BB-4950-9643-7BAEF5CEF6A8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blazor.Test", "Blazor.Test\Blazor.Test\Blazor.Test.csproj", "{4A47713C-2332-40C1-9AAB-7B2A14D148A2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.Test", "Blazor.Test\Blazor.Test\Blazor.Test.csproj", "{4A47713C-2332-40C1-9AAB-7B2A14D148A2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blazor.Test.Client", "Blazor.Test\Blazor.Test.Client\Blazor.Test.Client.csproj", "{20CA19C8-3036-4D1B-B095-C59A4C76B8D0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.Test.Client", "Blazor.Test\Blazor.Test.Client\Blazor.Test.Client.csproj", "{20CA19C8-3036-4D1B-B095-C59A4C76B8D0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

0 comments on commit babd6a9

Please sign in to comment.