diff --git a/.github/workflows/export.yml b/.github/workflows/export.yml new file mode 100644 index 00000000..1ebf6ffb --- /dev/null +++ b/.github/workflows/export.yml @@ -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 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 + diff --git a/export_presets.cfg b/export_presets.cfg index d69582c3..b84302db 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -13,7 +13,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 @@ -87,7 +87,7 @@ 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 @@ -136,7 +136,7 @@ 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 @@ -160,7 +160,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="" diff --git a/installer/ReadMe.rtf b/installer/ReadMe.rtf new file mode 100755 index 00000000..8ab4bf41 Binary files /dev/null and b/installer/ReadMe.rtf differ diff --git a/installer/rhythia.iss b/installer/rhythia.iss new file mode 100644 index 00000000..19d461e6 --- /dev/null +++ b/installer/rhythia.iss @@ -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}" + diff --git a/prefabs/modifier_button.tscn b/prefabs/modifier_button.tscn deleted file mode 100644 index 29657df1..00000000 --- a/prefabs/modifier_button.tscn +++ /dev/null @@ -1,17 +0,0 @@ -[gd_scene format=3 uid="uid://dndbtgq2yrwen"] - -[ext_resource type="Theme" uid="uid://dhuhu3mmaew1a" path="res://themes/theme.tres" id="1_bp66n"] -[ext_resource type="Texture2D" uid="uid://baivqqkfll133" path="res://textures/RhythiaSquircle.png" id="2_dhidr"] -[ext_resource type="Script" uid="uid://c8xhwjmasp86y" path="res://scripts/ui/menu/play/ModifierButton.cs" id="3_b55dm"] - -[node name="ModifierButton" type="Button" unique_id=1417833013] -offset_right = 58.0 -offset_bottom = 54.0 -focus_mode = 0 -mouse_default_cursor_shape = 2 -theme = ExtResource("1_bp66n") -theme_override_constants/icon_max_width = 42 -toggle_mode = true -icon = ExtResource("2_dhidr") -icon_alignment = 1 -script = ExtResource("3_b55dm") diff --git a/scripts/game/Runner.cs b/scripts/game/Runner.cs index 7eef5960..25ac427c 100644 --- a/scripts/game/Runner.cs +++ b/scripts/game/Runner.cs @@ -63,7 +63,7 @@ public override void _Ready() HudManager ??= GetNode("HUD"); Camera ??= GetNode("Camera3D"); - Renderers ??= new Godot.Collections.Array(GetNode("Renderers").GetChildren().OfType()); + Renderers ??= GetNode>("Renderers"); Grid ??= HudManager.GetNode("Grid"); Cursor ??= GetNode("Cursor"); // VideoStreamPlayer ??= GetNode("Video/VideoViewport/VideoStreamPlayer");