Skip to content
Merged

Indev #195

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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ csharp_style_namespace_declarations = file_scoped:warning
csharp_style_prefer_primary_constructors = false

#Roslyn severities
dotnet_diagnostic.IDE0130.severity = none
dotnet_diagnostic.IDE0130.severity = warning
dotnet_diagnostic.CA1305.severity = warning

[*.{yaml,yml}]
Expand Down
170 changes: 170 additions & 0 deletions .github/workflows/export.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
name: export

on:
push:
tags:
- "v*.*.*"

jobs:
export:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Verify project version
shell: bash
run: |
TAG="${GITHUB_REF_NAME#v}"
PROJECT_VERSION=$(grep -oP '(?<=config/version=")[^"]+' project.godot)

if [ "$PROJECT_VERSION" != "$TAG" ]; then
echo "::error file=project.godot::expected version $TAG (from tag) but found $PROJECT_VERSION"
exit 1
fi

- name: Verify xmllint
shell: bash
run: |
command -v xmllint >/dev/null 2>&1 || {
sudo apt-get update
sudo apt-get install -y --no-install-recommends libxml2-utils
}

- name: Verify project
id: godot
shell: bash
env:
CSPROJ_PATH: "Rhythia.csproj"
VERSION_FILE: ".github/godot_version.txt"
run: |
if compgen -G "${CSPROJ_PATH}.old*" > /dev/null; then
echo "::error file=${CSPROJ_PATH}.old::${CSPROJ_PATH}.old migration exists"
exit 1
fi

if [ ! -f "$CSPROJ_PATH" ]; then
echo "::error::$CSPROJ_PATH not found"
exit 1
fi

if [ ! -f "$VERSION_FILE" ]; then
echo "::error::$VERSION_FILE not found"
exit 1
fi

EXPECTED_VERSION=$(tr -d '[:space:]' < "$VERSION_FILE")
EXPECTED_SDK="Godot.NET.Sdk/${EXPECTED_VERSION}"

ACTUAL_SDK=$(xmllint --xpath 'string(/Project/@Sdk)' "$CSPROJ_PATH")

if [ -z "$ACTUAL_SDK" ]; then
echo "::error file=$CSPROJ_PATH::no <Project Sdk=\"...\"> attribute found"
exit 1
fi

if [ "$ACTUAL_SDK" != "$EXPECTED_SDK" ]; then
echo "::error file=$CSPROJ_PATH::expected Sdk=\"$EXPECTED_SDK\" but found Sdk=\"$ACTUAL_SDK\""
exit 1
fi

echo "Godot SDK OK: $ACTUAL_SDK"

echo "version=$EXPECTED_VERSION" >> "$GITHUB_OUTPUT"
echo "base_url=https://github.com/godotengine/godot-builds/releases/download/${EXPECTED_VERSION}-stable" >> "$GITHUB_OUTPUT"

- name: Setup
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # Dotnet 4.0.2
with:
dotnet-version: 10.0.x
cache: true

- name: Restore dependencies
run: dotnet restore --locked-mode

- name: Detect build type
id: kind
run: |
if [[ "$GITHUB_REF_NAME" == *-* ]]; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
else
echo "prerelease=false" >> "$GITHUB_OUTPUT"
fi

- name: Export builds
id: export
uses: firebelley/godot-export@615a6f7afc22d6266bf55c17748fb07447e8bdab # v8.0.0
with:
godot_executable_download_url: ${{ steps.godot.outputs.base_url }}/Godot_v${{ steps.godot.outputs.version }}-stable_mono_linux_x86_64.zip
godot_export_templates_download_url: ${{ steps.godot.outputs.base_url }}/Godot_v${{ steps.godot.outputs.version }}-stable_mono_export_templates.tpz
export_debug: ${{ steps.kind.outputs.prerelease }}
relative_project_path: ./
relative_export_path: builds
cache: true

- name: Verify exports exist
shell: bash
run: |
test -f "builds/Windows Desktop/Rhythia.exe" || { echo "::error::Windows export missing"; exit 1; }
test -f "builds/Linux/Rhythia.x86_64" || { echo "::error::Linux export missing"; exit 1; }
test -f "builds/macOS/Rhythia.zip" || { echo "::error::macOS export missing"; exit 1; }

- name: Compress exports
run: |
mkdir -p dist
(cd "builds/Windows Desktop" && zip -r "$GITHUB_WORKSPACE/dist/windows.zip" .)
(cd "builds/Linux" && zip -r "$GITHUB_WORKSPACE/dist/linux.zip" .)
cp builds/macOS/Rhythia.zip dist/macos.zip

- name: Upload Windows build for installer
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: rhythia-windows
path: builds/Windows Desktop/
if-no-files-found: error

- name: Create draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRERELEASE: ${{ steps.kind.outputs.prerelease }}
run: |
FLAGS=""
[[ "$PRERELEASE" == "true" ]] && FLAGS="--prerelease"
gh release view "$GITHUB_REF_NAME" > /dev/null 2>&1 || \
gh release create "$GITHUB_REF_NAME" --draft --title "$GITHUB_REF_NAME" $FLAGS

- name: Upload to GitHub Releases
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "$GITHUB_REF_NAME" dist/* --clobber
installer:
needs: export
runs-on: windows-latest
permissions:
contents: write

steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: rhythia-windows
path: builds/Windows Desktop/

- name: Build installer
run: |
$version = $env:GITHUB_REF_NAME.TrimStart('v')
& "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" `
"/DAppVersion=$version" `
"/DSourceDir=$env:GITHUB_WORKSPACE\builds\Windows Desktop" `
"/DOutputDir=$env:GITHUB_WORKSPACE\dist" `
installer\rhythia.iss
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

- name: Upload to GitHub Releases
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload $env:GITHUB_REF_NAME dist\*.exe --clobber

3 changes: 3 additions & 0 deletions Rhythia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net10.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<LangVersion>preview</LangVersion>
<ProjectDir>$(MSBuildProjectDirectory)\scripts\</ProjectDir>
<RootNamespace></RootNamespace>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
<ItemGroup>
<None Include=".editorconfig" />
Expand Down
64 changes: 57 additions & 7 deletions export_presets.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[runnable_presets]

"Windows Desktop"="Windows Desktop"
Linux="Linux"
"Linux x86_64"="Linux x86_64"
"Linux AArch64"="Linux AArch64"
macOS="macOS"

[preset.0]
Expand All @@ -13,7 +14,7 @@ custom_features=""
export_filter="all_resources"
include_filter="user/*"
exclude_filter=""
export_path="../../../Desktop/Windows/Rhythia.zip"
export_path="exports/Windows Desktop/Rhythia.exe"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
Expand Down Expand Up @@ -80,14 +81,14 @@ dotnet/embed_build_outputs=false

[preset.1]

name="Linux"
name="Linux x86_64"
platform="Linux"
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter="user/*"
exclude_filter=""
export_path="../../../Desktop/Linux/Rhythia.zip"
export_path="exports/Linux/Rhythia.x86_64"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
Expand Down Expand Up @@ -129,14 +130,63 @@ dotnet/embed_build_outputs=false

[preset.2]

name="Linux AArch64"
platform="Linux"
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter="user/*"
exclude_filter=""
export_path="../../../Desktop/Linux/Rhythia.zip"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
patch_delta_min_reduction=0.1
patch_delta_include_filters="*"
patch_delta_exclude_filters=""
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2

[preset.2.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=true
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
shader_baker/enabled=false
binary_format/architecture="arm64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="#!/usr/bin/env bash
export DISPLAY=:0
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
\"{temp_dir}/{exe_name}\" {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
pkill -x -f \"{temp_dir}/{exe_name} {cmd_args}\"
rm -rf \"{temp_dir}\""
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false

[preset.3]

name="macOS"
platform="macOS"
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter="user/*"
exclude_filter=""
export_path=""
export_path="exports/macOS/Rhythia.zip"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
Expand All @@ -150,7 +200,7 @@ encrypt_pck=false
encrypt_directory=false
script_export_mode=2

[preset.2.options]
[preset.3.options]

export/distribution_type=1
binary_format/architecture="universal"
Expand All @@ -160,7 +210,7 @@ debug/export_console_wrapper=1
application/liquid_glass_icon=""
application/icon=""
application/icon_interpolation=4
application/bundle_identifier=""
application/bundle_identifier="net.rhythia.client"
application/signature=""
application/app_category="Games"
application/short_version=""
Expand Down
Binary file added installer/ReadMe.rtf
Binary file not shown.
53 changes: 53 additions & 0 deletions installer/rhythia.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
; Non-commercial use only.

#define MyAppName "Rhythia"
#ifndef AppVersion
#define AppVersion "0.0.0"
#endif
#define MyAppVersion AppVersion
#define MyAppPublisher "Rhythia Org"
#define MyAppURL "https://github.com/Rhythia"
#define EscapeConstArgument(Value) StringChange(StringChange(StringChange(Value, "%", "%25"), ",", "%2c"), "}", "%7d")

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{58B8F9FB-4F1F-4953-BEA4-C7FA437761D9}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={cm:NameAndVersion,{#EscapeConstArgument(MyAppName)},{#EscapeConstArgument(MyAppVersion)}}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
InfoAfterFile=ReadMe.rtf
; Remove the following line to run in administrative install mode (install for all users).
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir={#OutputDir}
OutputBaseFilename=Rhythia Installer
SetupIconFile=..\textures\icon.ico
SolidCompression=yes
WizardStyle=modern dark polar

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "startmenuicon"; Description: "Create a &Start Menu shortcut"; GroupDescription: "{cm:AdditionalIcons}"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"

[Files]
Source: "{#SourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files.

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\Rhythia.exe"; Tasks: startmenuicon
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\Rhythia.exe"; Tasks: desktopicon
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"

Loading
Loading