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
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build PixelWorld binaries

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
runtime: linux-x64
artifact-name: pixelworld-linux-x64
- os: ubuntu-latest
runtime: linux-arm64
artifact-name: pixelworld-linux-arm64
- os: windows-latest
runtime: win-x64
artifact-name: pixelworld-win-x64
- os: windows-latest
runtime: win-arm64
artifact-name: pixelworld-win-arm64
- os: macos-latest
runtime: osx-x64
artifact-name: pixelworld-osx-x64
- os: macos-latest
runtime: osx-arm64
artifact-name: pixelworld-osx-arm64

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal

- name: Publish
run: |
dotnet publish ./CommandLine/CommandLine.csproj --configuration Release --runtime ${{ matrix.runtime }} --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false --output ./publish/${{ matrix.artifact-name }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ./publish/${{ matrix.artifact-name }}
retention-days: 90
2 changes: 1 addition & 1 deletion CommandLine/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private static void Main(string[] args)
app.Configure(config =>
{
config.SetApplicationName("pw.exe");
config.SetApplicationVersion("0.10");
config.SetApplicationVersion(typeof(Program).Assembly.GetName().Version?.ToString(3) ?? "Unknown");
AddCommands(config);
});

Expand Down
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<!-- Centralized version for all projects in this repository -->
<Version>0.5.0</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<FileVersion>$(Version)</FileVersion>
<InformationalVersion>$(Version)</InformationalVersion>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions PixelWorld.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{986EA84F-9F5D-4D8D-9B72-F79C53DEFBA9}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Global
Expand Down