Skip to content

Commit

Permalink
pull from base (#1)
Browse files Browse the repository at this point in the history
* Bit of tidying up

* Fixed bug where the selected value is not displayed (Blazored#278)

Co-authored-by: Ben Shemmeld <[email protected]>

* Updated TFM to .NET 6 and updated CI (Blazored#280)

* Update README.md

---------

Co-authored-by: Chris Sainty <[email protected]>
Co-authored-by: Ben Shemmeld <[email protected]>
Co-authored-by: Ben Shemmeld <[email protected]>
Co-authored-by: Chris Sainty <[email protected]>
  • Loading branch information
5 people authored Apr 17, 2024
1 parent f7ef8fb commit 0247983
Show file tree
Hide file tree
Showing 22 changed files with 394 additions and 417 deletions.
119 changes: 44 additions & 75 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,78 @@ name: Build & Test Main

on:
push:
branches: [ main ]
branches: [main]
release:
types: [ published ]
types: [published]

env:
NETCORE_VERSION: '3.1.301'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
PROJECT_NAME: Typeahead
GITHUB_FEED: https://nuget.pkg.github.com/Blazored/
GITHUB_USER: chrissainty
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_FEED: https://api.nuget.org/v3/index.json
NUGET_KEY: ${{ secrets.NUGET_KEY }}
NETCORE_VERSION: "6.0.x"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
PROJECT_NAME: Typeahead
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_FEED: https://api.nuget.org/v3/index.json
NUGET_KEY: ${{ secrets.NUGET_KEY }}

jobs:
build:
name: Build, test and pack
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Setup .NET Core ${{ env.NETCORE_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.NETCORE_VERSION }}
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Restore
run: dotnet restore

- name: Build
run: dotnet build -c Release --no-restore src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.csproj

- name: Test
run: dotnet test -c Release

- name: Pack
run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.*proj
- name: Setup .NET Core ${{ env.NETCORE_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.NETCORE_VERSION }}
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Publish Sample Site
run: dotnet publish -c Release samples/BlazorWebAssembly/BlazorWebAssembly.csproj
- name: Restore
run: dotnet restore

- name: Rewrite base href
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: samples/BlazorWebAssembly/bin/Release/netstandard2.1/publish/BlazorWebAssembly/dist/index.html
base_href: /${{ env.PROJECT_NAME }}/

- name: Deploy to Github Pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: $GITHUB_TOKEN
BASE_BRANCH: main # The branch the action should deploy from.
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: samples/BlazorWebAssembly/bin/Release/netstandard2.1/publish/BlazorWebAssembly/dist # The folder the action should deploy.
SINGLE_COMMIT: true
- name: Build Modal
run: dotnet build -c Release --no-restore src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.csproj

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: nupkg
path: ./src/Blazored.${{ env.PROJECT_NAME }}/bin/Release/*.nupkg
prerelease:
needs: build
if: github.event_name != 'release'
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: nupkg
- name: Push to GitHub Feed
run: |
for f in ./nupkg/*.nupkg
do
curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED
done
deploy:
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.NETCORE_VERSION }}

- name: Create Release NuGet package
run: |
arrTag=(${GITHUB_REF//\// })
VERSION="${arrTag[2]}"
echo Version: $VERSION
VERSION="${VERSION//v}"
echo Clean Version: $VERSION
dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.*proj
- name: Push to GitHub Feed
run: |
for f in ./nupkg/*.nupkg
do
curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED
done
dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.csproj
- name: Push to NuGet Feed
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --api-key $NUGET_KEY --skip-duplicate

- name: Publish Sample Site
run: dotnet publish -c Release samples/BlazorWebAssembly/BlazorWebAssembly.csproj

- name: Rewrite base href
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: samples/BlazorWebAssembly/bin/Release/net6.0/publish/wwwroot/index.html
base_href: /${{ env.PROJECT_NAME }}/

- name: Deploy to Github Pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: $GITHUB_TOKEN
BASE_BRANCH: main # The branch the action should deploy from.
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: samples/BlazorWebAssembly/bin/Release/net6.0/publish/wwwroot # The folder the action should deploy.
SINGLE_COMMIT: true
2 changes: 1 addition & 1 deletion .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches: [ main ]

env:
NETCORE_VERSION: '3.1.301'
PROJECT_NAME: Blazored.Typeahead
NETCORE_VERSION: '6.0.x'

jobs:
build:
Expand Down
3 changes: 1 addition & 2 deletions Blazored.Typeahead.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.28822.285
MinimumVisualStudioVersion = 15.0.26124.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazored.Typeahead", "src\Blazored.Typeahead\Blazored.Typeahead.csproj", "{35F86DB0-5B44-471B-BCDB-8108CAE6E22F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "samples", "{B3DF8680-26E4-4B3D-830C-C82818CDC305}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B3DF8680-26E4-4B3D-830C-C82818CDC305}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWebAssembly", "samples\BlazorWebAssembly\BlazorWebAssembly.csproj", "{02224AF2-F404-4E34-A47E-C0D64FFFE033}"
EndProject
Expand All @@ -15,7 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Shared", "samples\Sh
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8A0DDEA2-BB13-49E5-8A95-9142DB636664}"
ProjectSection(SolutionItems) = preProject
azure-pipelines.yml = azure-pipelines.yml
README.md = README.md
EndProjectSection
EndProject
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Blazored Typeahead
Typeahead control for Blazor applications.

[![Nuget version](https://img.shields.io/nuget/v/Blazored.Typeahead.svg?logo=nuget)](https://www.nuget.org/packages/Blazored.Typeahead/)
[![Nuget downloads](https://img.shields.io/nuget/dt/Blazored.Typeahead?logo=nuget)](https://www.nuget.org/packages/Blazored.Typeahead/)
![Build & Test Main](https://github.com/Blazored/Typeahead/workflows/Build%20&%20Test%20Main/badge.svg)

![Nuget](https://img.shields.io/nuget/v/blazored.typeahead.svg)

![Screenshot](screenshot.png)

### Installing
Expand Down Expand Up @@ -224,4 +224,4 @@ There are times when you will want to use complex types with the Typeahead but o
private Person LoadSelectedPerson(int? id) => People.FirstOrDefault(p => p.Id == id);
}
```
```
36 changes: 0 additions & 36 deletions azure-pipelines.yml

This file was deleted.

6 changes: 3 additions & 3 deletions samples/BlazorServer/BlazorServer.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.3</LangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 6 additions & 5 deletions samples/BlazorWebAssembly/App.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Router AppAssembly="typeof(Program).Assembly">
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)" />
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<LayoutView Layout="typeof(MainLayout)">
<h1>Page not found</h1>
<p>Sorry, but there's nothing here!</p>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
13 changes: 6 additions & 7 deletions samples/BlazorWebAssembly/BlazorWebAssembly.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.2.0-preview1.20073.1" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.2.0-preview1.20073.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.2.0-preview1.20073.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.2.0-preview1.20073.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 0247983

Please sign in to comment.