From 97a250bb4b13239b1a5f27ec988c3f47831381cb Mon Sep 17 00:00:00 2001 From: DomCR Date: Wed, 4 Dec 2024 17:48:58 +0100 Subject: [PATCH] action --- .github/workflows/publish.yml | 45 ++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a9b13e71..3b0f7442 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,24 +1,25 @@ -#name: Publish NuGet package +name: Publish NuGet package -#on: -# push: -# tags: -# - '*' +on: + workflow_dispatch: + release: + branches: [ master ] -#jobs: -# build: - -# runs-on: windows-latest - -# steps: -# - name: Checkout -# run: git config --global core.autocrlf true -# - uses: actions/checkout@v2 -# with: -# submodules: true -# - name: Restore dependencies -# run: dotnet restore -# - name: Build NuGet package -# run: dotnet pack ./ACadSharp.sln -c Release -o packages -# - name: Publish NuGet package -# run: dotnet nuget push .\packages\ACadSharp*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json \ No newline at end of file +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + - name: Publish NuGet package + working-directory: src + run: | + git submodule update --force --recursive --init --remote + dotnet restore + dotnet build --configuration Release + dotnet pack ./ACadSharp/ACadSharp.csproj --configuration Release + foreach($file in (Get-ChildItem ./nupkg -Recurse -Include *.nupkg)) { + dotnet nuget push $file --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + } \ No newline at end of file