diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24078c768..a2609a013 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,14 +3,14 @@ on: push: { branches: [develop, master] } pull_request: { branches: [master] } release: { types: [published] } -env: - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} jobs: buildForAllPlatforms: name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }} runs-on: ubuntu-latest + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} strategy: fail-fast: false matrix: @@ -33,24 +33,17 @@ jobs: with: path: Library key: Library-${{ matrix.targetPlatform }} - - name: free disk space - run: | - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - docker rmi $(docker image ls -aq) - df -h - - name: create android keystore - run: | - echo "${{ secrets.UNITY_ANDROID_KEYSTORE }}" > finoldigital.keystore.asc - gpg -d --passphrase "${{ secrets.UNITY_ANDROID_KEYSTORE_PASS }}" --batch finoldigital.keystore.asc > finoldigital.keystore - - uses: webbertakken/unity-builder@bf702784d2650ed3933a93d0592b1927acc057a7 + - uses: davidmfinol/unity-builder@4bbcbe6395a50f6afe3576a4371126cd998055c5 with: unityVersion: ${{ matrix.unityVersion }} targetPlatform: ${{ matrix.targetPlatform }} buildsPath: builds - buildMethod: Cgs.Editor.BuildCgs.BuildProject - customParameters: -androidAppBundle -keystorePass ${{ secrets.UNITY_ANDROID_KEYSTORE_PASS }} -keyaliasPass ${{ secrets.UNITY_ANDROID_KEYSTORE_PASS }} + androidAppBundle: true + androidKeystoreName: finoldigital.keystore + androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }} + androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }} + androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }} - uses: actions/upload-artifact@v1 if: github.event.ref != 'refs/heads/develop' with: @@ -91,19 +84,19 @@ jobs: with: name: cgs-builds path: builds - - run: | + - name: Prepare for upload + run: | echo "$GOOGLE_PLAY_KEY_FILE" > $GOOGLE_PLAY_KEY_FILE_PATH echo "$RELEASE_NOTES" > fastlane/metadata/android/en-US/changelogs/default.txt + find $BUILDS_PATH -type f -iname "*.sh" -exec chmod +x {} \; + chmod +x fastlane/sign-osx-build.sh + ./fastlane/sign-osx-build.sh - uses: maierj/fastlane-action@v1.4.0 with: lane: 'android playstore' - - run: find $BUILDS_PATH -type f -iname "*.sh" -exec chmod +x {} \; - uses: maierj/fastlane-action@v1.4.0 with: lane: 'ios release' - - run: | - chmod +x fastlane/sign-osx-build.sh - ./fastlane/sign-osx-build.sh - uses: maierj/fastlane-action@v1.4.0 with: lane: 'mac macupload' diff --git a/Assets/Scripts/CardGameDef/CardGame.cs b/Assets/Scripts/CardGameDef/CardGame.cs index 047edc1d2..7a230be73 100644 --- a/Assets/Scripts/CardGameDef/CardGame.cs +++ b/Assets/Scripts/CardGameDef/CardGame.cs @@ -181,7 +181,7 @@ public class CardGame [JsonProperty] [Description( - "If cardNameIsUnique is true, different Cards are not allowed to have the same *Card:Name*. Cards with the same name will be treated as reprints, with the option to hide reprints available. If cardNameIsUnique false, DeckFileType.Txt will require for every Card.")] + "If cardNameIsUnique is true, different Cards are not allowed to have the same *Card:Name*. Cards with the same name will be treated as reprints, with the option to hide reprints available. If cardNameIsUnique is false, DeckFileType.Txt will require for every Card.")] [DefaultValue(true)] public bool CardNameIsUnique { get; set; } = true; diff --git a/Assets/Scripts/Cgs/Editor/BuildCgs.cs b/Assets/Scripts/Cgs/Editor/BuildCgs.cs deleted file mode 100644 index 6003aa97a..000000000 --- a/Assets/Scripts/Cgs/Editor/BuildCgs.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using JetBrains.Annotations; -using UnityEditor; -using UnityEditor.Build.Reporting; - -namespace Cgs.Editor -{ - internal static class BuildCgs - { - private static readonly string Eol = Environment.NewLine; - - [UsedImplicitly] - public static void BuildProject() - { - // Gather values from args - Dictionary options = GetValidatedOptions(); - - // Gather values from project - string[] scenes = EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(s => s.path).ToArray(); - - // Define BuildPlayer Options - var buildOptions = new BuildPlayerOptions - { - scenes = scenes, - locationPathName = options["customBuildPath"], - target = (BuildTarget) Enum.Parse(typeof(BuildTarget), options["buildTarget"]), - }; - - // Support automatic versioning - PlayerSettings.bundleVersion = options["version"]; - PlayerSettings.macOS.buildNumber = options["version"]; - - // Support Android signing - if (buildOptions.target == BuildTarget.Android) - { - PlayerSettings.Android.bundleVersionCode = int.Parse(options["androidVersionCode"]); - PlayerSettings.Android.keystorePass = options["keystorePass"]; - PlayerSettings.Android.keyaliasPass = options["keyaliasPass"]; - if (options.ContainsKey("androidAppBundle")) - { - EditorUserBuildSettings.buildAppBundle = true; - } - } - - // Perform build - BuildReport buildReport = BuildPipeline.BuildPlayer(buildOptions); - - // Summary - BuildSummary summary = buildReport.summary; - ReportSummary(summary); - - // Result - BuildResult result = summary.result; - ExitWithResult(result); - } - - private static void ParseCommandLineArguments(out Dictionary providedArguments) - { - providedArguments = new Dictionary(); - string[] args = Environment.GetCommandLineArgs(); - - Console.WriteLine( - $"{Eol}" + - $"###########################{Eol}" + - $"# Parsing settings #{Eol}" + - $"###########################{Eol}" + - $"{Eol}" - ); - - // Extract flags with optional values - for (int current = 0, next = 1; current < args.Length; current++, next++) - { - // Parse flag - bool isFlag = args[current].StartsWith("-"); - if (!isFlag) continue; - string flag = args[current].TrimStart('-'); - - // Parse optional value - bool flagHasValue = next < args.Length && !args[next].StartsWith("-"); - string value = flagHasValue ? args[next].TrimStart('-') : ""; - - // Assign -// Console.WriteLine($"Found flag \"{flag}\" with value \"{value}\"."); - providedArguments.Add(flag, value); - } - } - - private static Dictionary GetValidatedOptions() - { - ParseCommandLineArguments(out Dictionary validatedOptions); - - if (!validatedOptions.TryGetValue("projectPath", out string _)) - { - Console.WriteLine("Missing argument -projectPath"); - EditorApplication.Exit(110); - } - - if (!validatedOptions.TryGetValue("buildTarget", out string buildTarget)) - { - Console.WriteLine("Missing argument -buildTarget"); - EditorApplication.Exit(120); - } - - if (!Enum.IsDefined(typeof(BuildTarget), buildTarget ?? throw new ArgumentNullException())) - { - EditorApplication.Exit(121); - } - - if (!validatedOptions.TryGetValue("customBuildPath", out string customBuildPath)) - { - Console.WriteLine("Missing argument -customBuildPath"); - EditorApplication.Exit(130); - } - else if (validatedOptions.ContainsKey("androidAppBundle") && customBuildPath.Contains("apk")) - { - validatedOptions["customBuildPath"] = customBuildPath.Replace("apk", "aab"); - } - - const string defaultCustomBuildName = "TestBuild"; - if (!validatedOptions.TryGetValue("customBuildName", out string customBuildName)) - { - Console.WriteLine($"Missing argument -customBuildName, defaulting to {defaultCustomBuildName}."); - validatedOptions.Add("customBuildName", defaultCustomBuildName); - } - else if (customBuildName == "") - { - Console.WriteLine($"Invalid argument -customBuildName, defaulting to {defaultCustomBuildName}."); - validatedOptions.Add("customBuildName", defaultCustomBuildName); - } - - return validatedOptions; - } - - private static void ReportSummary(BuildSummary summary) - { - Console.WriteLine( - $"{Eol}" + - $"###########################{Eol}" + - $"# Build results #{Eol}" + - $"###########################{Eol}" + - $"{Eol}" + - $"Duration: {summary.totalTime.ToString()}{Eol}" + - $"Warnings: {summary.totalWarnings.ToString()}{Eol}" + - $"Errors: {summary.totalErrors.ToString()}{Eol}" + - $"Size: {summary.totalSize.ToString()} bytes{Eol}" + - $"{Eol}" - ); - } - - private static void ExitWithResult(BuildResult result) - { - if (result == BuildResult.Succeeded) - { - Console.WriteLine("Build succeeded!"); - EditorApplication.Exit(0); - } - - if (result == BuildResult.Failed) - { - Console.WriteLine("Build failed!"); - EditorApplication.Exit(101); - } - - if (result == BuildResult.Cancelled) - { - Console.WriteLine("Build cancelled!"); - EditorApplication.Exit(102); - } - - if (result == BuildResult.Unknown) - { - Console.WriteLine("Build result is unknown!"); - EditorApplication.Exit(103); - } - } - } -} diff --git a/Assets/Scripts/Cgs/Editor/BuildCgs.cs.meta b/Assets/Scripts/Cgs/Editor/BuildCgs.cs.meta deleted file mode 100644 index e5e1c101e..000000000 --- a/Assets/Scripts/Cgs/Editor/BuildCgs.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 270fd410f68ae894c8125a49060e7d5a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/docs/pages/roadmap.md b/docs/pages/roadmap.md index 4b417f427..f248dd2ef 100644 --- a/docs/pages/roadmap.md +++ b/docs/pages/roadmap.md @@ -8,6 +8,7 @@ permalink: roadmap.html - Enhance backend ## Current Sprint +- Filter '@' when creating game in-app - Fix: Card moved to server, but is still in hand - Play Mode Redesign - gamePlayDeckName (default="Stock", "Square Wall" for Mahjong) diff --git a/docs/schema/CardGameDef.json b/docs/schema/CardGameDef.json index 56d2d925c..114528cc9 100644 --- a/docs/schema/CardGameDef.json +++ b/docs/schema/CardGameDef.json @@ -135,7 +135,7 @@ }, "cardNameIsUnique": { "type": "boolean", - "description": "If cardNameIsUnique is true, different Cards are not allowed to have the same *Card:Name*. Cards with the same name will be treated as reprints, with the option to hide reprints available. If cardNameIsUnique false, DeckFileType.Txt will require for every Card.", + "description": "If cardNameIsUnique is true, different Cards are not allowed to have the same *Card:Name*. Cards with the same name will be treated as reprints, with the option to hide reprints available. If cardNameIsUnique is false, DeckFileType.Txt will require for every Card.", "default": true }, "cardPrimaryProperty": {