diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index 2dbc208..55729aa 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -13,7 +13,12 @@ jobs: steps: - name: Checkout the repository - uses: actions/checkout@v1 + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Fetch all branches (used by GitVersion) + run: git fetch --prune --unshallow - name: Setup .NET Core uses: actions/setup-dotnet@v1 @@ -21,28 +26,41 @@ jobs: dotnet-version: 3.1.200 - name: Restore library - run: dotnet restore BlazorLazyLoading.sln + run: dotnet restore BlazorLazyLoading.sln -p:BLLUseLocalNugetPackages=true - name: Build library - run: dotnet build -c Release BlazorLazyLoading.sln + run: dotnet build BlazorLazyLoading.sln -c Release -p:BLLUseLocalNugetPackages=true - name: Test library - run: dotnet test -c Release BlazorLazyLoading.sln + run: dotnet test BlazorLazyLoading.sln -c Release -p:BLLUseLocalNugetPackages=true - name: Pack library - run: dotnet pack -c Release BlazorLazyLoading.sln - - - name: Upload artifacts - uses: actions/upload-artifact@v1 - with: - name: output - path: output + run: dotnet pack BlazorLazyLoading.sln -c Release -p:BLLUseLocalNugetPackages=true - name: Restore demo - run: dotnet restore -p:BLLUseLocalNugetPackages=true demo/Demo.sln + run: dotnet restore demo/Demo.sln -p:BLLUseLocalNugetPackages=true - name: Build demo - run: dotnet build -c Release -p:BLLUseLocalNugetPackages=true demo/Demo.sln + run: dotnet build demo/Demo.sln -c Release -p:BLLUseLocalNugetPackages=true + + - name: Publish demo + run: dotnet publish demo/ServerHost/ServerHost.csproj -c Release -p:BLLUseLocalNugetPackages=true -o output/demo - name: Test demo - run: dotnet test -c Release demo/Demo.sln + run: dotnet test demo/Demo.sln -c Release + + - name: Prepare for Github Pages deployment + run: find output/demo -name "*.gitignore" -type f -print0 | xargs -0 /bin/rm -f + + - name: Deploy demo to Github Pages + uses: jamesives/github-pages-deploy-action@3.4.8 + with: + FOLDER: output/demo/wwwroot + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages + + - name: Upload artifacts + uses: actions/upload-artifact@v1 + with: + name: output + path: output diff --git a/.github/workflows/nuget-publish.yml b/.github/workflows/nuget-publish.yml index 99c23a1..df08921 100644 --- a/.github/workflows/nuget-publish.yml +++ b/.github/workflows/nuget-publish.yml @@ -20,7 +20,12 @@ jobs: steps: - name: Checkout the repository - uses: actions/checkout@v1 + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Fetch all branches (used by GitVersion) + run: git fetch --prune --unshallow - name: Setup .NET Core uses: actions/setup-dotnet@v1 @@ -28,28 +33,41 @@ jobs: dotnet-version: 3.1.200 - name: Restore library - run: dotnet restore BlazorLazyLoading.sln + run: dotnet restore BlazorLazyLoading.sln -p:BLLUseLocalNugetPackages=true - name: Build library - run: dotnet build -c Release BlazorLazyLoading.sln - + run: dotnet build BlazorLazyLoading.sln -c Release -p:BLLUseLocalNugetPackages=true + - name: Test library - run: dotnet test -c Release BlazorLazyLoading.sln + run: dotnet test BlazorLazyLoading.sln -c Release -p:BLLUseLocalNugetPackages=true - name: Pack library - run: dotnet pack -c Release BlazorLazyLoading.sln + run: dotnet pack BlazorLazyLoading.sln -c Release -p:BLLUseLocalNugetPackages=true - name: Restore demo - run: dotnet restore -p:BLLUseLocalNugetPackages=true demo/Demo.sln + run: dotnet restore demo/Demo.sln -p:BLLUseLocalNugetPackages=true - name: Build demo - run: dotnet build -c Release -p:BLLUseLocalNugetPackages=true demo/Demo.sln + run: dotnet build demo/Demo.sln -c Release -p:BLLUseLocalNugetPackages=true + + - name: Publish demo + run: dotnet publish demo/ServerHost/ServerHost.csproj -c Release -p:BLLUseLocalNugetPackages=true -o output/demo - name: Test demo - run: dotnet test -c Release demo/Demo.sln + run: dotnet test demo/Demo.sln -c Release - name: Push package to NuGet - run: dotnet nuget push output/**/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate + run: dotnet nuget push output/nuget/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate + + - name: Prepare for Github Pages deployment + run: find output/demo -name "*.gitignore" -type f -print0 | xargs -0 /bin/rm -f + + - name: Deploy demo to Github Pages + uses: jamesives/github-pages-deploy-action@3.4.8 + with: + FOLDER: output/demo/wwwroot + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages - name: Upload artifacts uses: actions/upload-artifact@v1 diff --git a/BlazorLazyLoading.sln b/BlazorLazyLoading.sln index 74d753c..a65c75c 100644 --- a/BlazorLazyLoading.sln +++ b/BlazorLazyLoading.sln @@ -25,7 +25,10 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{AE8E1C15-B862-43CB-AC0E-94B83BE0A250}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets GitVersion.yml = GitVersion.yml + nuget.config = nuget.config EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorLazyLoading.Server", "nuget\BlazorLazyLoading.Server\BlazorLazyLoading.Server.csproj", "{B14D3B51-3320-46B7-8815-0FF3F18DBCB3}" @@ -183,29 +186,17 @@ Global {10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Release|x86.ActiveCfg = Release|Any CPU {10AB33A5-80F4-4D02-9DBE-0484C3BB6954}.Release|x86.Build.0 = Release|Any CPU {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Debug|Any CPU.Build.0 = Debug|Any CPU {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Debug|x64.ActiveCfg = Debug|Any CPU - {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Debug|x64.Build.0 = Debug|Any CPU {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Debug|x86.ActiveCfg = Debug|Any CPU - {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Debug|x86.Build.0 = Debug|Any CPU {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Release|Any CPU.Build.0 = Release|Any CPU {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Release|x64.ActiveCfg = Release|Any CPU - {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Release|x64.Build.0 = Release|Any CPU {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Release|x86.ActiveCfg = Release|Any CPU - {2EF3EB2F-0E00-4554-8EDC-7CEEE5C7B899}.Release|x86.Build.0 = Release|Any CPU {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Debug|x64.ActiveCfg = Debug|Any CPU - {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Debug|x64.Build.0 = Debug|Any CPU {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Debug|x86.ActiveCfg = Debug|Any CPU - {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Debug|x86.Build.0 = Debug|Any CPU {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Release|Any CPU.Build.0 = Release|Any CPU {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Release|x64.ActiveCfg = Release|Any CPU - {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Release|x64.Build.0 = Release|Any CPU {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Release|x86.ActiveCfg = Release|Any CPU - {D2DF44FE-098D-48EF-925B-F71DFDD7134D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Directory.Build.props b/Directory.Build.props index fc93ba1..e413b91 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,4 +5,9 @@ $(MSBuildThisFileDirectory) + + + false + + diff --git a/README.md b/README.md index e1e503e..ab7264d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # Blazor Lazy Loading + +[![demo](https://img.shields.io/badge/demo-click%20here-blue)](https://isc30.github.io/blazor-lazy-loading/) + Automatic Lazy Loading support for Blazor WebAssembly (wasm) and Blazor Server diff --git a/demo/Directory.Build.props b/demo/Directory.Build.props index 42b3b16..0b65214 100644 --- a/demo/Directory.Build.props +++ b/demo/Directory.Build.props @@ -2,6 +2,11 @@ + + + $(MSBuildThisFileDirectory) + + false diff --git a/demo/NuGet.Config b/demo/NuGet.Config index 49869d8..8668f68 100644 --- a/demo/NuGet.Config +++ b/demo/NuGet.Config @@ -1,6 +1,6 @@ - + diff --git a/demo/WasmHost/wwwroot/404.html b/demo/WasmHost/wwwroot/404.html new file mode 100644 index 0000000..1cfbf3c --- /dev/null +++ b/demo/WasmHost/wwwroot/404.html @@ -0,0 +1,38 @@ + + + + + + + + + + + BlazorLazyLoading + + + + + + Loading... + +
+ An unhandled error has occurred. + Reload + 🗙 +
+ + + + diff --git a/demo/WasmHost/wwwroot/index.html b/demo/WasmHost/wwwroot/index.html index 5493620..1cfbf3c 100644 --- a/demo/WasmHost/wwwroot/index.html +++ b/demo/WasmHost/wwwroot/index.html @@ -1,11 +1,25 @@ - + - WasmHost + + + + BlazorLazyLoading diff --git a/nuget.config b/nuget.config index f5bed5b..d9cc7af 100644 --- a/nuget.config +++ b/nuget.config @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/nuget/BlazorLazyLoading.Module/BlazorLazyLoading.Module.csproj b/nuget/BlazorLazyLoading.Module/BlazorLazyLoading.Module.csproj index 6783a63..1127a93 100644 --- a/nuget/BlazorLazyLoading.Module/BlazorLazyLoading.Module.csproj +++ b/nuget/BlazorLazyLoading.Module/BlazorLazyLoading.Module.csproj @@ -26,7 +26,7 @@ - + diff --git a/nuget/NugetCommon.props b/nuget/NugetCommon.props index 5043e30..89f573f 100644 --- a/nuget/NugetCommon.props +++ b/nuget/NugetCommon.props @@ -8,8 +8,8 @@ - $(MSBuildThisFileDirectory)..\output - $(MSBuildThisFileDirectory)..\output + $(MSBuildThisFileDirectory)..\output\nuget + $(MSBuildThisFileDirectory)..\output\nuget @@ -67,7 +67,7 @@ diff --git a/output/demo/.nojekyll b/output/demo/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/output/.gitignore b/output/nuget/.gitignore similarity index 100% rename from output/.gitignore rename to output/nuget/.gitignore