Merge pull request #15 from metaone01/develop #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish To NuGet | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 检出代码 | |
| - uses: actions/checkout@v5 | |
| # 设置 .NET 环境 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 9.0.x | |
| # 恢复依赖项 | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| # 构建项目 | |
| - name: Build project | |
| run: dotnet build .\src\RelativeControl.Avalonia\RelativeControl.Avalonia.csproj --configuration Release | |
| # 发布到 NuGet.org | |
| - name: Publish Packages to NuGet | |
| run: dotnet nuget push ./src/RelativeControl.Avalonia/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} | |
| - name: Publish Package Symbols to NuGet | |
| run: dotnet nuget push ./src/RelativeControl.Avalonia/bin/Release/*.snupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |