Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
Ugraded to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
stanoddly committed Feb 29, 2024
1 parent fa494b1 commit c11b4ea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
with:
path: DotnetRaylibWasmRepo

- name: Setup .NET7
- name: Setup .NET8
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.100'
dotnet-version: '8.0.200'

- name: Install wasm-tools
run: |
Expand All @@ -27,7 +27,8 @@ jobs:
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v11
with:
version: 3.1.12
# https://github.com/dotnet/runtime/blob/v8.0.2/src/mono/wasm/emscripten-version.txt
version: 3.1.34
actions-cache-folder: 'emsdk-cache'

- name: Build raylib for Web
Expand All @@ -49,4 +50,4 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: DotnetRaylibWasmRepo/DotnetRaylibWasm/bin/Release/net7.0/browser-wasm/AppBundle
publish_dir: DotnetRaylibWasmRepo/DotnetRaylibWasm/bin/Release/net8.0/browser-wasm/AppBundle
3 changes: 2 additions & 1 deletion DotnetRaylibWasm/DotnetRaylibWasm.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<WasmMainJSPath>main.js</WasmMainJSPath>
<OutputType>Exe</OutputType>
Expand All @@ -14,6 +14,7 @@
<TrimMode>full</TrimMode>
<!-- This is to basically disable globalization to exclude icudt.dat (1.5MB) and reduce size of dotnet.wasm -->
<InvariantGlobalization>true</InvariantGlobalization>
<LangVersion>12</LangVersion>
</PropertyGroup>

<Choose>
Expand Down
4 changes: 2 additions & 2 deletions Examples/Examples.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory>
<LangVersion>11</LangVersion>
<LangVersion>12</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

[GitHub Pages Demo](https://disketteman.github.io/DotnetRaylibWasm/)

This is a fully working prototype for .NET 7 with Raylib ahead-of-time 🚀 compiled into WebAssembly (wasm). See a couple of [known issues](https://github.com/disketteman/DotnetRaylibWasm/issues) for limitations.
This is a fully working prototype for .NET 8 with Raylib ahead-of-time 🚀 compiled into WebAssembly (wasm). See a couple of [known issues](https://github.com/disketteman/DotnetRaylibWasm/issues) for limitations.

## Local setup

Make sure you have the latest version of .NET 7 for example from [here](https://dotnet.microsoft.com/en-us/download/dotnet/7.0), the prototype was built with:
Make sure you have the latest version of .NET 8 for example from [here](https://dotnet.microsoft.com/en-us/download/dotnet/8.0), the prototype was built with:
```
dotnet --version
7.0.100
8.0.200
```

Install the official wasm tooling:
Expand Down Expand Up @@ -50,13 +50,13 @@ The project which makes the WebAssembly possible is here:
`publish` the solution from the root of the repository. Don't even try to use just `build`, [it's buggy](https://github.com/disketteman/DotnetRaylibWasm/issues/7#issuecomment-1356442508). Note the publishing takes a while:

```
dotnet publish -C Release
dotnet publish -c Release
```

To serve the files use this command from the root (change `\` to `/` in file path if you are not on Windows):

```
dotnet serve --mime .wasm=application/wasm --mime .js=text/javascript --mime .json=application/json --directory DotnetRaylibWasm\bin\Debug\net7.0\browser-wasm\AppBundle\
dotnet serve --mime .wasm=application/wasm --mime .js=text/javascript --mime .json=application/json --directory DotnetRaylibWasm\bin\Debug\net8.0\browser-wasm\AppBundle\
```

Copy the link from the output and open it in your browser (tested on the latest Chrome).
Expand Down

0 comments on commit c11b4ea

Please sign in to comment.