Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand All @@ -32,8 +33,12 @@ jobs:
id: gitversion
shell: bash
run: |
MAJOR_MINOR_PATCH=$(dotnet gitversion /output json /showvariable MajorMinorPatch)
PRE_RELEASE_LABEL=$(dotnet gitversion /output json /showvariable PreReleaseLabel)
VERSION=$(dotnet gitversion /output json /showvariable SemVer)
SAFE_VERSION=$(echo "$VERSION" | sed -E 's/[^A-Za-z0-9._+-]+/-/g')
echo "MAJOR_MINOR_PATCH=$MAJOR_MINOR_PATCH" >> $GITHUB_ENV
echo "PRE_RELEASE_LABEL=$PRE_RELEASE_LABEL" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_SAFE=$SAFE_VERSION" >> $GITHUB_ENV

Expand Down Expand Up @@ -113,6 +118,45 @@ jobs:
echo "::error::Expected an existing git tag '${VERSION}' (or 'v${VERSION}') before creating a stable release."
exit 1

- name: Resolve Release Notes File
if: steps.release_channel.outputs.channel != 'none'
id: release_notes
shell: bash
run: |
if [ "${{ steps.release_channel.outputs.channel }}" = "stable" ]; then
notes_file="release-notes/${MAJOR_MINOR_PATCH}.md"
else
notes_file="release-notes/${MAJOR_MINOR_PATCH}-${{ steps.release_channel.outputs.channel }}.md"
fi

if [ ! -f "${notes_file}" ]; then
fallback_notes_file="release-notes/${{ steps.release_channel.outputs.channel }}.md"

if [ -f "${fallback_notes_file}" ]; then
notes_file="${fallback_notes_file}"
else
echo "::error::Expected release notes file '${notes_file}' was not found and fallback '${fallback_notes_file}' was not available."
exit 1
fi
fi

echo "file=${notes_file}" >> $GITHUB_OUTPUT

- name: Render Release Notes
if: steps.release_channel.outputs.channel != 'none'
id: render_release_notes
shell: bash
run: |
rendered_notes_file="$(mktemp)"

sed \
-e "s/{{VERSION}}/${VERSION}/g" \
-e "s/{{NUGET_VERSION}}/${VERSION}/g" \
-e "s/{{MAJOR_MINOR_PATCH}}/${MAJOR_MINOR_PATCH}/g" \
"${{ steps.release_notes.outputs.file }}" > "${rendered_notes_file}"

echo "file=${rendered_notes_file}" >> $GITHUB_OUTPUT

- name: Create GitHub release
if: steps.release_channel.outputs.channel != 'none'
env:
Expand All @@ -130,6 +174,9 @@ jobs:
fi

if gh release view "${{ steps.resolve_tag.outputs.tag }}" >/dev/null 2>&1; then
gh release edit "${{ steps.resolve_tag.outputs.tag }}" \
--notes-file "${{ steps.render_release_notes.outputs.file }}"

gh release upload "${{ steps.resolve_tag.outputs.tag }}" \
/tmp/artifacts/blazor-hashrouting/package/release/Blazor.HashRouting.${VERSION}.nupkg \
/tmp/artifacts/blazor-hashrouting/package/release/Blazor.HashRouting.${VERSION}.snupkg \
Expand All @@ -140,6 +187,7 @@ jobs:
/tmp/artifacts/blazor-hashrouting/package/release/Blazor.HashRouting.${VERSION}.snupkg \
--title "${{ steps.release_channel.outputs.label }} ${{ steps.resolve_tag.outputs.tag }}" \
--target "${GITHUB_SHA}" \
--notes-file "${{ steps.render_release_notes.outputs.file }}" \
"${release_args[@]}"
fi

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@

- Initial standalone release preparation.
- Prepared the package for independent build, test, and NuGet packaging.

## 1.0.0-rc.1

- First release candidate of `Blazor.HashRouting`.
- Added reusable hash-fragment routing for browser-hosted Blazor WebAssembly applications.
- Added canonical `/#/...` routing, internal link interception, back/forward handling, and navigation lock integration.
- Added standalone NuGet packaging, static web assets, and independent CI/release automation.
- Multi-targeted the package for `net9.0` and `net10.0`.
50 changes: 50 additions & 0 deletions release-notes/1.0.0-rc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Blazor.HashRouting {{VERSION}}

## Summary

Release candidate build for the `{{MAJOR_MINOR_PATCH}}` line of `Blazor.HashRouting`, a reusable hash-fragment routing engine for browser-hosted Blazor WebAssembly applications.

This package is intended for environments where the host can serve the application root document and static assets, but cannot reliably serve deep-linked route paths on refresh.

## Highlights

- Hash-fragment routing built on top of Blazor's navigation model
- Canonical `/#/...` URL handling
- Internal link interception for same-origin navigation
- Browser back/forward and hash change support
- Navigation lock integration
- Standalone NuGet-ready packaging with static web assets
- Multi-targeted for `net9.0` and `net10.0`

## Installation

```bash
dotnet add package Blazor.HashRouting --version {{NUGET_VERSION}}
```

## Basic usage

```csharp
using Blazor.HashRouting;

var builder = WebAssemblyHostBuilder.CreateDefault(args);

builder.Services.AddHashRouting();

await builder.Build().RunAsync();
```

## URL examples

- Root route: `/#/`
- Nested route: `/#/settings`
- Base-path route: `/proxy/app/#/settings`

## Supported environments

- Blazor WebAssembly running in a browser

## Not supported

- Blazor Server
- Blazor Hybrid
50 changes: 50 additions & 0 deletions release-notes/1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Blazor.HashRouting {{VERSION}}

## Summary

Stable release for the `{{MAJOR_MINOR_PATCH}}` line of `Blazor.HashRouting`, a reusable hash-fragment routing engine for browser-hosted Blazor WebAssembly applications.

This package is intended for environments where the host can serve the application root document and static assets, but cannot reliably serve deep-linked route paths on refresh.

## Highlights

- Hash-fragment routing built on top of Blazor's navigation model
- Canonical `/#/...` URL handling
- Internal link interception for same-origin navigation
- Browser back/forward and hash change support
- Navigation lock integration
- Standalone NuGet-ready packaging with static web assets
- Multi-targeted for `net9.0` and `net10.0`

## Installation

```bash
dotnet add package Blazor.HashRouting --version {{NUGET_VERSION}}
```

## Basic usage

```csharp
using Blazor.HashRouting;

var builder = WebAssemblyHostBuilder.CreateDefault(args);

builder.Services.AddHashRouting();

await builder.Build().RunAsync();
```

## URL examples

- Root route: `/#/`
- Nested route: `/#/settings`
- Base-path route: `/proxy/app/#/settings`

## Supported environments

- Blazor WebAssembly running in a browser

## Not supported

- Blazor Server
- Blazor Hybrid
13 changes: 13 additions & 0 deletions release-notes/alpha.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Blazor.HashRouting {{VERSION}}

## Summary

Alpha build of `Blazor.HashRouting`.

This prerelease is intended for early validation of hash-fragment routing in browser-hosted Blazor WebAssembly applications.

## Installation

```bash
dotnet add package Blazor.HashRouting --version {{NUGET_VERSION}}
```
13 changes: 13 additions & 0 deletions release-notes/beta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Blazor.HashRouting {{VERSION}}

## Summary

Beta build of `Blazor.HashRouting`.

This prerelease is intended for broader validation of hash-fragment routing in browser-hosted Blazor WebAssembly applications.

## Installation

```bash
dotnet add package Blazor.HashRouting --version {{NUGET_VERSION}}
```
8 changes: 4 additions & 4 deletions src/Blazor.HashRouting/Blazor.HashRouting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.13" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.4" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading