Skip to content

Commit 161a136

Browse files
updated with auto build workflow, icon, license and nuget package updates
1 parent 64dd023 commit 161a136

File tree

5 files changed

+50
-21
lines changed

5 files changed

+50
-21
lines changed

.github/workflows/dotnet.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: Build-Release
5+
6+
on:
7+
push:
8+
branches: ["master"]
9+
pull_request:
10+
branches: ["master"]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: 8.0.x
22+
- name: Restore dependencies
23+
run: dotnet restore
24+
- name: Release Build
25+
run: dotnet build --configuration Release --no-restore
26+
- name: Pack NuGet package
27+
run: dotnet pack --configuration Release --no-build --output nupkgs
28+
- name: Push to NuGet.org
29+
run: dotnet nuget push "nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Christopher Pritchard
3+
Copyright (c) 2025 Christopher Pritchard
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1-
# Xelmish - XNA + Elmish!
1+
# Xelmish - XNA + Elmish
22

3-
[![Nuget](https://img.shields.io/nuget/v/xelmish.svg?maxAge=0&colorB=brightgreen)](https://www.nuget.org/packages/xelmish)
3+
![.NET](https://github.com/ChrisPritchard/xelmish/actions/workflows/dotnet.yml/badge.svg) [![Nuget](https://img.shields.io/nuget/v/xelmish.svg?maxAge=0&colorB=brightgreen)](https://www.nuget.org/packages/xelmish)
44

5-
**Xelmish** is a small project that creates an **X**NA Game loop (via Mono Game) and connects it to the **Elmish** MVU architecture, via a custom setState method in its own version of the classic Elmish.Program module (Xelmish.Program).
5+
**Xelmish** is a small project that creates an **X**NA Game loop (via Mono Game) and connects it to the **Elmish** MVU architecture, via a custom setState method in its own version of the classic Elmish.Program module (Xelmish.Program).
66

77
In this way, you can develop games using the excellent Elmish architecture, with all the power of an XNA renderer! You can also convert existing Elmish applications to use Xelmish by rewriting their view functions.
88

99
To use Xelmish, the Elmish program must provide a view function that returns a list of 'viewables', functions which take an XNA SpriteBatch. A set of common such functions like colour, image and text are provided in the Xelmish Viewables helper module.
1010

1111
Xelmish is for **2D games** (the SpriteBatch object is for drawing textures, not rendering vertices). Hopefully it allows users to develop such games rapidly using the Elm architecture and F#!
1212

13-
**Update: Available on Nuget [here](https://www.nuget.org/packages/xelmish)**
14-
15-
**Update Update**: the project and its samples were recently upgraded to .NET 5. The older, dotnet core 2.2 version can be found in [this branch](https://github.com/ChrisPritchard/Xelmish/tree/fs-applied-2019), though its mainly just the framework that changed, not any code effectively.
16-
17-
**Update Update Update**: the project and its samples are now .NET 6, along with a MonoGame version bump.
18-
19-
**Update Update Update Update**: the project and its samples are now .NET 68, along with a MonoGame version bump.
20-
2113
## Simple Example of Usage
2214

2315
The simplest usage of Xelmish is shown in the first sample, [xelmish-first](./samples/xelmish-first/Program.fs). This sample renders a square to the screen, and allows you to move and resize it with key presses. It doesnt have any loaded assets like textures, fonts or sound, and therefore also doesn't require the monogame content pipeline. Nice and simple.
@@ -40,6 +32,8 @@ It has been upgraded since to MonoGame 3.8, and the core Xelmish project made cr
4032

4133
**UPDATE 2024** It has been updated to .NET 8, and compiled using dotnet cli. Tested on Windows 11.
4234

35+
**UPDATE 2025** Latest versions of core dependencies added: elmish 5 and monogame 3.8.4. Minor rework was required for subscription changes in elmish.
36+
4337
### A note for Linux builders
4438

4539
On Linux the Monogame Content Pipeline may not work by default. If you get mono failure errors, try installing mono-complete, e.g. `sudo apt install mono-complete`. I was able to compile and run the samples on Ubuntu 18.04 after this without issue.
@@ -74,11 +68,11 @@ This is also the first sample that uses audio, with retro beeps and explosions b
7468

7569
## History and Reasoning
7670

77-
Xelmish has been built for the **[2019 F# Applied Competition](http://foundation.fsharp.org/applied_fsharp_challenge)**, but also as a replacement architecture for my prior [fsharp-gamecore](https://github.com/ChrisPritchard/fsharp-gamecore) experimental engine.
71+
Xelmish has been built for the **[2019 F# Applied Competition](http://foundation.fsharp.org/applied_fsharp_challenge)**, but also as a replacement architecture for my prior [fsharp-gamecore](https://github.com/ChrisPritchard/fsharp-gamecore) experimental engine.
7872

7973
> **Update:** While Xelmish unfortunately did not win in the competition, my [other](https://github.com/ChrisPritchard/FSH) submission did. Full results [here](http://foundation.fsharp.org/results_applied_fsharp_2019).
8074
81-
While I have successfully built several small games with gamecore, I was finding that as my games increased in complexity the very simplistic model/view architecture in gamecore started to get stretched and warp. Things which were view-specific started to leak into model, and vice versa.
75+
While I have successfully built several small games with gamecore, I was finding that as my games increased in complexity the very simplistic model/view architecture in gamecore started to get stretched and warp. Things which were view-specific started to leak into model, and vice versa.
8276

8377
In contrast the battle-tested Elmish model has, so far, proved a pleasure to work with. Much more elegant, and it has also achieved in a far better way my goal of having games being purely functional (where performance permits) and agnostic of engine. The MVU architecture, and parent-child relationships that the Elm architecture handles so well, mean that a game can be designed and theorised without having the engine get in the way, which is (in my opinion) ideal.
8478

icon.png

12.2 KB
Loading

src/Xelmish.fsproj

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,25 @@
66
<ProjectGuid>{e03c5917-b17d-43c6-ab71-680f1178c4ab}</ProjectGuid>
77
</PropertyGroup>
88

9-
<PropertyGroup>
10-
<PackageVersion>0.0.6</PackageVersion>
9+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
10+
<IsPackable>true</IsPackable>
11+
<PackageVersion>1.0.0</PackageVersion>
1112
<PackageId>xelmish</PackageId>
1213
<Title>Xelmish</Title>
13-
<Authors>Christopher Pritchard (https://github.com/ChrisPritchard)</Authors>
14-
<Description>A set of helpers and types that allow you to write XNA games using the Elmish
15-
framework. Updated for NET 5 and MonoGame 3.8</Description>
16-
<PackageTags>monogame fsharp xna elmish</PackageTags>
17-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
14+
<Authors>Chris Pritchard</Authors>
15+
<Description>A set of helpers and types that allow you to write XNA (Monogame) games using
16+
the Elmish framework. Updated for NET 8, Elmish 5 and MonoGame 3.8.4</Description>
17+
<PackageTags>monogame;fsharp;xna;elmish</PackageTags>
18+
<PackageIcon>icon.png</PackageIcon>
19+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1820
<RepositoryUrl>https://github.com/ChrisPritchard/Xelmish</RepositoryUrl>
21+
<PackageReadmeFile>README.md</PackageReadmeFile>
1922
</PropertyGroup>
2023

2124
<ItemGroup>
25+
<None Include="../LICENSE" Pack="true" PackagePath="" />
26+
<None Include="../README.md" Pack="true" PackagePath="" />
27+
<None Include="../icon.png" Pack="true" PackagePath="" />
2228
<Compile Include="Model.fs" />
2329
<Compile Include="Viewables.fs" />
2430
<Compile Include="UI.fs" />

0 commit comments

Comments
 (0)