Skip to content

GitHub Pages #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Apr 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 32 additions & 14 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,54 @@ 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
with:
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/[email protected]
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
38 changes: 28 additions & 10 deletions .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,54 @@ 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
with:
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/[email protected]
with:
FOLDER: output/demo/wwwroot
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages

- name: Upload artifacts
uses: actions/upload-artifact@v1
Expand Down
15 changes: 3 additions & 12 deletions BlazorLazyLoading.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
</PropertyGroup>

<!-- Convert $(BLLUseLocalNugetPackages) to bool -->
<PropertyGroup>
<BLLUseLocalNugetPackages Condition="'$(BLLUseLocalNugetPackages)' == ''">false</BLLUseLocalNugetPackages>
</PropertyGroup>

</Project>
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions demo/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

<Import Project="LocalNugetVersion.props" />

<PropertyGroup>
<!-- Polyfill $(SolutionDir) -->
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
</PropertyGroup>

<!-- Convert $(BLLUseLocalNugetPackages) to bool -->
<PropertyGroup>
<BLLUseLocalNugetPackages Condition="'$(BLLUseLocalNugetPackages)' == ''">false</BLLUseLocalNugetPackages>
Expand Down
2 changes: 1 addition & 1 deletion demo/NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="local-repo" value="../output/" />
<add key="local-repo" value="../output/nuget/" />
</packageSources>
</configuration>
38 changes: 38 additions & 0 deletions demo/WasmHost/wwwroot/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />

<base href="/" />
<script type="text/javascript">
// if domain ends with .github.io, fix <base href ...>
if (window.location.host.endsWith(".github.io"))
{
var base = window.location.protocol
+ "//" + window.location.host
+ "/" + window.location.pathname.split("/")[1] + "/";

baseElement = document.getElementsByTagName("head")[0].getElementsByTagName("base")[0];
baseElement.href = base;
}
</script>

<title>BlazorLazyLoading</title>
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
</head>

<body>
<app>Loading...</app>

<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>
</body>

</html>
18 changes: 16 additions & 2 deletions demo/WasmHost/wwwroot/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>WasmHost</title>

<base href="/" />
<script type="text/javascript">
// if domain ends with .github.io, fix <base href ...>
if (window.location.host.endsWith(".github.io"))
{
var base = window.location.protocol
+ "//" + window.location.host
+ "/" + window.location.pathname.split("/")[1] + "/";

baseElement = document.getElementsByTagName("head")[0].getElementsByTagName("base")[0];
baseElement.href = base;
}
</script>

<title>BlazorLazyLoading</title>
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
</head>
Expand Down
2 changes: 1 addition & 1 deletion nuget.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="local-repo" value="output/" />
<add key="local-repo" value="output/nuget/" />
</packageSources>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<None Remove="build\bin\**" />
</ItemGroup>

<Target Name="CopyBinToBuild" AfterTargets="Build">
<Target Name="CopyBinToBuild" AfterTargets="Build" Condition="!$(BLLUseLocalNugetPackages)">
<Message Importance="high" Text="[HACK] Copying bin files..." />
<ItemGroup>
<BinFiles Include="$(MSBuildThisFileDirectory)bin/$(Configuration)/$(TargetFramework)/**/*.*" />
Expand Down
6 changes: 3 additions & 3 deletions nuget/NugetCommon.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</ItemGroup>

<PropertyGroup>
<PackageOutputDir>$(MSBuildThisFileDirectory)..\output</PackageOutputDir>
<PackageOutputPath>$(MSBuildThisFileDirectory)..\output</PackageOutputPath>
<PackageOutputDir>$(MSBuildThisFileDirectory)..\output\nuget</PackageOutputDir>
<PackageOutputPath>$(MSBuildThisFileDirectory)..\output\nuget</PackageOutputPath>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -67,7 +67,7 @@
</ItemGroup>

<WriteLinesToFile
File="$(SolutionDir)demo/LocalNugetVersion.props"
File="$(MSBuildThisFileDirectory)../demo/LocalNugetVersion.props"
Lines="@(LocalNugetVersionProps)"
Overwrite="true" />
</Target>
Expand Down
Empty file added output/demo/.nojekyll
Empty file.
File renamed without changes.