From 30dd095e5a22fe9e33a94779933e6d35358fb20d Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Tue, 10 Dec 2024 16:25:23 +0200 Subject: [PATCH] Fix --- .github/workflows/ci.yml | 73 ++++++++------------------ PrismSharp.Core/PrismSharp.Core.csproj | 21 ++++---- PrismSharp.Core/PrismSharp.Core.nuspec | 31 +++++++++++ 3 files changed, 64 insertions(+), 61 deletions(-) create mode 100644 PrismSharp.Core/PrismSharp.Core.nuspec diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e356666..fafceaf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,63 +4,36 @@ on: [push, pull_request] jobs: build: - - env: - BUILD_CONFIG: 'Release' - SOLUTION: 'PrismSharp.sln' - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 with: - submodules: 'true' - - # - name: Get Build Version - # run: | - # Import-Module .\scripts\GetBuildVersion.psm1 - # Write-Host $Env:GITHUB_REF - # $version = GetBuildVersion -VersionString $Env:GITHUB_REF - # echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append - # shell: pwsh - - - name: Setup NuGet - uses: NuGet/setup-nuget@v1.0.5 - - # - name: Restore dependencies - # run: nuget restore $SOLUTION + submodules: 'recursive' - - name: Setup .NET - uses: actions/setup-dotnet@v1 + - name: Setup .NET 9 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.x + dotnet-version: 9.x.x - - name: Restore dependencies by dotnet sdk - run: dotnet restore $SOLUTION - - - name: Build - run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore - - - name: Run tests - run: dotnet test --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal - - name: Pack - if: startsWith(github.ref, 'refs/tags/') + run: >- + dotnet build PrismSharp.RegExCompiler/PrismSharp.RegExCompiler.csproj --configuration Release; + dotnet build PrismSharp.SourceGenerator/PrismSharp.SourceGenerator.csproj --configuration Release; + dotnet build PrismSharp.Core/PrismSharp.Core.csproj --configuration Release; + + dotnet pack PrismSharp.Core/PrismSharp.Core.csproj --configuration Release -o "./packages"; + shell: pwsh + + + - name: Push to NuGet + run: dotnet nuget push "./packages/*.nupkg" -k ${{secrets.NUGET_API_KEY}} -s https://www.nuget.org + shell: pwsh + + - name: Push to GPR run: | - dotnet pack --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal + for f in ./packages/*.nupkg + do + curl -vX PUT -u "vslee:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/BUTR/ + done + shell: bash - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - files: | - **/*.nupkg - # TODO: create changelog.md - # body_path: changelog.md - - - name: Publish to nuget.org - if: startsWith(github.ref, 'refs/tags/') - run: | - dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} diff --git a/PrismSharp.Core/PrismSharp.Core.csproj b/PrismSharp.Core/PrismSharp.Core.csproj index e025d4f..334f16d 100644 --- a/PrismSharp.Core/PrismSharp.Core.csproj +++ b/PrismSharp.Core/PrismSharp.Core.csproj @@ -1,22 +1,21 @@ - PrismSharp.Core - 0.1.4 - A porting of PrismJS to C# or .NET. - MIT - enable net45;netstandard2.0;net8.0;net9.0 latest - https://github.com/tatwd/prism-sharp - README.md + enable true + + 0 + 1.0.0.$(GITHUB_RUN_NUMBER) + + $(MSBuildThisFileDirectory)..\packages\ + true + + $(MSBuildThisFileDirectory)PrismSharp.Core.nuspec + Version=$(Version);Configuration=$(Configuration) - - - - SimpleJSON.cs diff --git a/PrismSharp.Core/PrismSharp.Core.nuspec b/PrismSharp.Core/PrismSharp.Core.nuspec new file mode 100644 index 0000000..e3ca3c7 --- /dev/null +++ b/PrismSharp.Core/PrismSharp.Core.nuspec @@ -0,0 +1,31 @@ + + + + BUTR.PrismSharp.Core + $version$ + false + MIT + A porting of PrismJS to C# or .NET. Fork for BUTR use. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file