Skip to content

添加 NoneCaseNamingPolicy 的单元测试并更新项目文件 #17

添加 NoneCaseNamingPolicy 的单元测试并更新项目文件

添加 NoneCaseNamingPolicy 的单元测试并更新项目文件 #17

Workflow file for this run

name: Publish NuGet Package
on:
push:
branches:
- main # 触发工作流的分支
jobs:
build:
runs-on: ubuntu-latest
env:
PROJECT_DIR: EfCore.NamingConverter # 工作目录
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET 8.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup .NET 9.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
working-directory: ${{ env.PROJECT_DIR }}
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: ${{ env.PROJECT_DIR }}
- name: Test
run: dotnet test --no-build --verbosity normal
working-directory: ${{ env.PROJECT_DIR }}
- name: Pack
run: dotnet pack --configuration Release --no-build --output ./nupkg
working-directory: ${{ env.PROJECT_DIR }}
- name: Upload NuGet package
uses: actions/upload-artifact@v3
with:
name: nuget-package
path: ${{ env.PROJECT_DIR }}/nupkg/*.nupkg
- name: Publish to NuGet
if: github.ref == 'refs/heads/main'
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
working-directory: ${{ env.PROJECT_DIR }}