Skip to content

Commit

Permalink
Port CI pipeline from TAS tools
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Feb 3, 2024
1 parent 1ac45a0 commit ed8e89a
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 14 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build
on:
workflow_dispatch:
push:
branches: [ '*' ]
paths-ignore:
- "ReadMe.md"
- ".gitignore"
- ".editorconfig"
pull_request:
branches: [ '*' ]
paths-ignore:
- "ReadMe.md"
- ".gitignore"
- ".editorconfig"

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get current commit
run: echo "CURRENT_COMMIT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Build
run: dotnet publish -r win-x64 -c Release "-p:EmbeddedBuildProperty=ModVersion=${{env.CURRENT_COMMIT}}-dev"
- name: Copy Content
run: cp -r Content bin/Release/net8.0/win-x64/publish
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Celeste64-SpeedrunUtils-${{env.CURRENT_COMMIT}}
path: bin/Release/net8.0/win-x64/publish

25 changes: 13 additions & 12 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:
push:
tags: [ '*' ]

permissions:
contents: write

Expand All @@ -22,12 +22,12 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Build Windows x86_64
run: dotnet publish -c Release -r win-x64 --self-contained
- name: Build Linux x86_64
run: dotnet publish -c Release -r linux-x64 --self-contained
- name: Build MacOS x86_64
run: dotnet publish -c Release -r osx-x64 --self-contained
- name: Build Windows x86-64
run: dotnet publish -c Release -r win-x64 "-p:EmbeddedBuildProperty=ModVersion=${{env.CURRENT_TAG}}"
- name: Build Linux x86-64
run: dotnet publish -c Release -r linux-x64 "-p:EmbeddedBuildProperty=ModVersion=${{env.CURRENT_TAG}}"
- name: Build macOS x86-64
run: dotnet publish -c Release -r osx-x64 "-p:EmbeddedBuildProperty=ModVersion=${{env.CURRENT_TAG}}"
- name: Copy Content
run: |
cp -r Content bin/Release/net8.0/win-x64/publish
Expand All @@ -47,16 +47,17 @@ jobs:
- name: Publish Github Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{env.CURRENT_TAG}}
name: Celeste 64 SpeedrunUtils v${{env.CURRENT_TAG}}
body: |
# Instructions:
- Download and extract the zip file below according to your computer
- Download and extract the zip file below according to your computer
- Run the Celeste64 application from the extracted files
# Requirements:
- **Windows:** 10 or later, x64
- **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64
- **Mac:** Monterey or later, x64 Intel-based or Apple Silicon with Rosetta
- **macOS:** Monterey or later, x64 Intel-based or Apple Silicon with Rosetta
files: Celeste64-SpeedrunUtils-*.zip
2 changes: 2 additions & 0 deletions Celeste64.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<PackageReference Include="FosterFramework" Version="0.1.14-alpha" />
<PackageReference Include="SharpGLTF.Runtime" Version="1.0.0-alpha0031" />
<PackageReference Include="Sledge.Formats.Map" Version="1.1.5" />

<PackageReference Include="EmbeddedBuildProperty" Version="1.0.0" />
</ItemGroup>

<ItemGroup Condition="($(RuntimeIdentifier) == '' And $([MSBuild]::IsOSPlatform('Linux'))) Or $(RuntimeIdentifier.StartsWith('linux'))">
Expand Down
9 changes: 9 additions & 0 deletions Source/BuildProperties.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Celeste64;

using EmbeddedBuildProperty;

public partial class BuildProperties
{
[BuildProperty]
public static partial string ModVersion();
}
4 changes: 2 additions & 2 deletions Source/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public enum TransitionStep // SpeedrunUtils: publicized
public const int Width = 640;
public const int Height = 360;
public static readonly Version Version = typeof(Game).Assembly.GetName().Version!;
public static readonly Version SpeedrunUtilsVersion = new Version(0, 2, 2);
public static readonly string VersionString = $"v.{Version.Major}.{Version.Minor}.{Version.Build} - SpeedrunUtils v.{SpeedrunUtilsVersion.Major}.{SpeedrunUtilsVersion.Minor}.{SpeedrunUtilsVersion.Build}";
public static string TASVersion => string.IsNullOrEmpty(BuildProperties.ModVersion()) ? "dev" : BuildProperties.ModVersion();
public static string VersionString => $"v.{Version.Major}.{Version.Minor}.{Version.Build} - SpeedrunUtils v.{TASVersion}";

/// <summary>
/// Used by various rendering elements to proportionally scale if you change the default game resolution
Expand Down

0 comments on commit ed8e89a

Please sign in to comment.