From 5323668faa198150ad7496cb92f2d7885bb228c7 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Mon, 24 Apr 2023 18:32:46 -0600 Subject: [PATCH 01/27] Add .circleci/config.yml --- .circleci/config.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..4175da6cf --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,26 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference +version: 2.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/configuration-reference/#jobs +jobs: + say-hello: + # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/configuration-reference/#executor-job + docker: + - image: cimg/base:stable + # Add steps to the job + # See: https://circleci.com/docs/configuration-reference/#steps + steps: + - checkout + - run: + name: "Say hello" + command: "echo Hello, World!" + +# Orchestrate jobs using workflows +# See: https://circleci.com/docs/configuration-reference/#workflows +workflows: + say-hello-workflow: + jobs: + - say-hello From 61c4bff54ec9c30fbf59197084e9eda4fdf2bc80 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 10:43:38 -0600 Subject: [PATCH 02/27] Update config.yml --- .circleci/config.yml | 53 ++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4175da6cf..b6c7ec4f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,26 +1,41 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/configuration-reference version: 2.1 - -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/configuration-reference/#jobs jobs: - say-hello: - # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/configuration-reference/#executor-job + build: + working_directory: ~/project docker: - - image: cimg/base:stable - # Add steps to the job - # See: https://circleci.com/docs/configuration-reference/#steps + - image: cimg/android:2022.01 + environment: + - BUILD_ANDROID=YES steps: - checkout - run: - name: "Say hello" - command: "echo Hello, World!" + name: Install Dependencies + command: | + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - + #!/bin/bash -eo pipefail + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg + echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list + sudo apt-get update + sudo apt-get -qq install wget unzip libgd-dev libc6-i386 lib32stdc++6 lib32gcc-s1 lib32ncurses6 lib32z1 jq ant lib32ncurses6 libgd-dev -# Orchestrate jobs using workflows -# See: https://circleci.com/docs/configuration-reference/#workflows -workflows: - say-hello-workflow: - jobs: - - say-hello + wget https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip -nv + wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz -nv + + - run: + name: Setup Android + command: | + export ANDROID="android-sdk-linux/tools/android" + export PATH="$PATH:$ANDROID_HOME/tools" + unzip android-ndk-r22-linux-x86_64.zip + tar -zxf android-sdk_r24.4.1-linux.tgz + $ANDROID list sdk --extended -a && + echo yes | $ANDROID update sdk -a -t tools,platform-tools,build-tools-23.0.1,android-23 --no-ui --force --no-https + sudo apt-get install openjdk-11-jdk + export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 + export PATH=$JAVA_HOME/bin:$PATH + + - run: + name: Build Android + command: | + echo $PWD + bash ./tools/circle-script.sh From 6eebfa77a4d1c8e854556ad93ea22b922ae02cfc Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 11:15:23 -0600 Subject: [PATCH 03/27] Create circle-script.sh --- tools/circle-script.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tools/circle-script.sh diff --git a/tools/circle-script.sh b/tools/circle-script.sh new file mode 100644 index 000000000..1ed9d2a0c --- /dev/null +++ b/tools/circle-script.sh @@ -0,0 +1,42 @@ +#!/bin/sh -e + +# let's dump some info to debug a bit +echo ls = `ls` +echo pwd = `pwd` +# computing potential release name +echo CIRCLE_PR_NUMBER = $CIRCLE_PR_NUMBER +echo CIRCLE_BRANCH = $CIRCLE_BRANCH + +if [ -z "$CIRCLE_PR_NUMBER" ]; then + if [ "$CIRCLE_BRANCH" = "alphas" ]; then + export RELEASE_NAME="alpha-${CIRCLE_BUILD_NUM}" + elif [ "$CIRCLE_BRANCH" = "master" ]; then + export RELEASE_NAME="latest-master" + fi +fi + +echo RELEASE_NAME = $RELEASE_NAME + + +# updating versions with the CIRCLE build numbers +cd projects/mtg/ +ant update > error.txt +cd ../.. + +# we create resource package +if [ "$BUILD_RES" = "YES" ] || [ "$BUILD_PSP" = "YES" ]; then + cd projects/mtg/bin/Res + python createResourceZip.py + # if we let the zip here, Wagic will use it in the testsuite + # and we'll get 51 failed test cases + mv core_*.zip ../../../../core.zip + cd ../../../.. +fi + +# we're building an Android binary here +if [ "$BUILD_ANDROID" = "YES" ]; then + android-ndk-r22/ndk-build -C projects/mtg/Android -j4 + $ANDROID list targets + $ANDROID update project -t 1 -p projects/mtg/Android + ant debug -f projects/mtg/Android/build.xml +fi From ecd4b85e2248b51e2157acff365aeaf2d7d72581 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 11:22:48 -0600 Subject: [PATCH 04/27] Update config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b6c7ec4f4..28d31a112 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,7 @@ jobs: - image: cimg/android:2022.01 environment: - BUILD_ANDROID=YES + ANDROID_HOME: /usr/local/android-sdk-linux steps: - checkout - run: From 947277af5a25d6291449090965ce108eba29f1ab Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 11:24:42 -0600 Subject: [PATCH 05/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 28d31a112..cc1fa284a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: docker: - image: cimg/android:2022.01 environment: - - BUILD_ANDROID=YES + - BUILD_ANDROID:YES ANDROID_HOME: /usr/local/android-sdk-linux steps: - checkout From 05e857f735453748a3992517506f0ae1f996b7e3 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 11:25:13 -0600 Subject: [PATCH 06/27] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cc1fa284a..a785a92a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,8 +5,8 @@ jobs: docker: - image: cimg/android:2022.01 environment: - - BUILD_ANDROID:YES - ANDROID_HOME: /usr/local/android-sdk-linux + BUILD_ANDROID: "YES" + ANDROID_HOME: "/usr/local/android-sdk-linux" steps: - checkout - run: From 9efd2bcfebeea04f5ad161c8a55c4260e96b33a9 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 11:31:12 -0600 Subject: [PATCH 07/27] Update config.yml --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a785a92a0..b6c7ec4f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,8 +5,7 @@ jobs: docker: - image: cimg/android:2022.01 environment: - BUILD_ANDROID: "YES" - ANDROID_HOME: "/usr/local/android-sdk-linux" + - BUILD_ANDROID=YES steps: - checkout - run: From 73b33bb0a054f7f163f7eaab453ae2071ba44cc5 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 11:34:19 -0600 Subject: [PATCH 08/27] Update circle-script.sh --- tools/circle-script.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/circle-script.sh b/tools/circle-script.sh index 1ed9d2a0c..7d187fd5e 100644 --- a/tools/circle-script.sh +++ b/tools/circle-script.sh @@ -36,7 +36,7 @@ fi # we're building an Android binary here if [ "$BUILD_ANDROID" = "YES" ]; then android-ndk-r22/ndk-build -C projects/mtg/Android -j4 - $ANDROID list targets - $ANDROID update project -t 1 -p projects/mtg/Android + android-sdk-linux/tools/android list targets + android-sdk-linux/tools/android update project -t 1 -p projects/mtg/Android ant debug -f projects/mtg/Android/build.xml fi From 756a8907c88bd3c4ff2e83c31eaa4e54dc98f5a8 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 12:17:06 -0600 Subject: [PATCH 09/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b6c7ec4f4..3eec035f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: working_directory: ~/project docker: - - image: cimg/android:2022.01 + - image: cimg/android:2020.01 environment: - BUILD_ANDROID=YES steps: From bd76554186aab1c0788c20a1ca4c60b20735e1fd Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 12:18:18 -0600 Subject: [PATCH 10/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3eec035f3..1d7e16932 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: working_directory: ~/project docker: - - image: cimg/android:2020.01 + - image: circleci/android:api-31-node environment: - BUILD_ANDROID=YES steps: From b3712a8cf194d46da0805c268cfcc33b365348be Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 12:19:53 -0600 Subject: [PATCH 11/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d7e16932..921421848 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: working_directory: ~/project docker: - - image: circleci/android:api-31-node + - image: circleci/android:api-30 environment: - BUILD_ANDROID=YES steps: From b613da48dbc7210870460d54a67dc6108582abf1 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 12:22:02 -0600 Subject: [PATCH 12/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 921421848..5a482ef04 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: working_directory: ~/project docker: - - image: circleci/android:api-30 + - image: circleci/openjdk:8-jdk-stretch environment: - BUILD_ANDROID=YES steps: From 8204d5a5c163ab56011934e60b16f182ecc741d6 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 12:23:19 -0600 Subject: [PATCH 13/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a482ef04..841b40e36 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: working_directory: ~/project docker: - - image: circleci/openjdk:8-jdk-stretch + - image: circleci/openjdk:8-jdk environment: - BUILD_ANDROID=YES steps: From 6e98e6f9e61b390fcb055e344370b2eb71063c7c Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 13:37:03 -0600 Subject: [PATCH 14/27] Update config.yml --- .circleci/config.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 841b40e36..f89a6990d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,3 +39,15 @@ jobs: command: | echo $PWD bash ./tools/circle-script.sh + - run: + name: Upload APK to GitHub Releases + command: | + curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - + ./bin/linux/amd64/github-release upload \ + --user \ + --repo \ + --tag \ + --name Wagic-debug.apk \ + --file projects/mtg/Android/bin/Wagic-debug.apk \ + --token $GITHUB_TOKEN + From 5b560732436d1f7a5c36969c81f018847c01d4b8 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 13:57:17 -0600 Subject: [PATCH 15/27] Update config.yml --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f89a6990d..0ca0a74f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,9 +44,9 @@ jobs: command: | curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - ./bin/linux/amd64/github-release upload \ - --user \ - --repo \ - --tag \ + --user EduardoMunozGomez \ + --repo wagic \ + --tag androide \ --name Wagic-debug.apk \ --file projects/mtg/Android/bin/Wagic-debug.apk \ --token $GITHUB_TOKEN From 4a9733b5107a8f820f19079b12d1ea1c78bf08d1 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 14:00:36 -0600 Subject: [PATCH 16/27] Update config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0ca0a74f1..3daea1767 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,7 @@ jobs: - image: circleci/openjdk:8-jdk environment: - BUILD_ANDROID=YES + parallelism: 2 steps: - checkout - run: From d2e1cf34ca0f943ebb6669e98a96913dfbbd38b9 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 14:08:44 -0600 Subject: [PATCH 17/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3daea1767..64faee629 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,5 +50,5 @@ jobs: --tag androide \ --name Wagic-debug.apk \ --file projects/mtg/Android/bin/Wagic-debug.apk \ - --token $GITHUB_TOKEN + --token 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 From ea6596a43167901d4fd6ff131db65eb5970bce60 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 14:16:10 -0600 Subject: [PATCH 18/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 64faee629..201932969 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,5 +50,5 @@ jobs: --tag androide \ --name Wagic-debug.apk \ --file projects/mtg/Android/bin/Wagic-debug.apk \ - --token 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 + --security-token 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 From 203876aadb951b3086551b570835a18122942c3d Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 16:13:23 -0600 Subject: [PATCH 19/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 201932969..20f5b85f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,7 @@ jobs: ./bin/linux/amd64/github-release upload \ --user EduardoMunozGomez \ --repo wagic \ - --tag androide \ + --tag circle \ --name Wagic-debug.apk \ --file projects/mtg/Android/bin/Wagic-debug.apk \ --security-token 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 From b8ea9e6b5fb2360daf9eaf58d91897df8ee941a6 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 16:26:27 -0600 Subject: [PATCH 20/27] Update config.yml --- .circleci/config.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 20f5b85f9..e1fb080a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,12 +43,5 @@ jobs: - run: name: Upload APK to GitHub Releases command: | - curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - - ./bin/linux/amd64/github-release upload \ - --user EduardoMunozGomez \ - --repo wagic \ - --tag circle \ - --name Wagic-debug.apk \ - --file projects/mtg/Android/bin/Wagic-debug.apk \ - --security-token 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 + python tools/upload-binaries.py -t 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 -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH From 6ae8984b412d485a68031d84d712e28a1cf8296b Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 16:27:54 -0600 Subject: [PATCH 21/27] Update config.yml --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e1fb080a4..aa710e593 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,4 +44,12 @@ jobs: name: Upload APK to GitHub Releases command: | python tools/upload-binaries.py -t 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 -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH + curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - + ./bin/linux/amd64/github-release upload \ + --user EduardoMunozGomez \ + --repo wagic \ + --tag circle \ + --name Wagic-debug.apk \ + --file projects/mtg/Android/bin/Wagic-debug.apk \ + --security-token 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 From 2eb719919c528b8c845fb4c4cf8cf8b5f9c18b80 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 16:33:00 -0600 Subject: [PATCH 22/27] Update config.yml --- .circleci/config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index aa710e593..cb975c901 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,6 +40,20 @@ jobs: command: | echo $PWD bash ./tools/circle-script.sh + + dependencies: + pre: + - sudo apt-get update + - sudo apt-get install -y curl python-pip bzip2 + - curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - + - sudo pip install --upgrade pip + - sudo pip install setuptools-rust + - sudo pip install pyOpenSSL + - sudo pip install pyjavaproperties + - sudo pip install github3.py + - sudo pip install cpp-coveralls + + - run: name: Upload APK to GitHub Releases command: | From ee86e7b478dc1c80c22719ab656b15448421870c Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 16:38:10 -0600 Subject: [PATCH 23/27] Update config.yml --- .circleci/config.yml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cb975c901..2b02427bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,6 @@ jobs: name: Install Dependencies command: | curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - - #!/bin/bash -eo pipefail curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list sudo apt-get update @@ -34,26 +33,26 @@ jobs: sudo apt-get install openjdk-11-jdk export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 export PATH=$JAVA_HOME/bin:$PATH - + - run: name: Build Android command: | echo $PWD bash ./tools/circle-script.sh - - dependencies: - pre: - - sudo apt-get update - - sudo apt-get install -y curl python-pip bzip2 - - curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - - - sudo pip install --upgrade pip - - sudo pip install setuptools-rust - - sudo pip install pyOpenSSL - - sudo pip install pyjavaproperties - - sudo pip install github3.py - - sudo pip install cpp-coveralls - + - run: + name: Install Required Packages + command: | + sudo apt-get update + sudo apt-get install -y curl python-pip bzip2 + curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - + sudo pip install --upgrade pip + sudo pip install setuptools-rust + sudo pip install pyOpenSSL + sudo pip install pyjavaproperties + sudo pip install github3.py + sudo pip install cpp-coveralls + - run: name: Upload APK to GitHub Releases command: | @@ -65,5 +64,3 @@ jobs: --tag circle \ --name Wagic-debug.apk \ --file projects/mtg/Android/bin/Wagic-debug.apk \ - --security-token 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 - From 5d41f6dfdbe99358231d9ebddbadfa0e9b9aeabf Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 16:43:41 -0600 Subject: [PATCH 24/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b02427bc..c964555de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,7 +44,7 @@ jobs: name: Install Required Packages command: | sudo apt-get update - sudo apt-get install -y curl python-pip bzip2 + sudo apt-get install -y curl python3-pip bzip2 curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - sudo pip install --upgrade pip sudo pip install setuptools-rust From a19ede4c12e59f66297a1d4bc3031d787002609c Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 7 May 2023 16:48:19 -0600 Subject: [PATCH 25/27] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c964555de..31f100a01 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,7 +56,7 @@ jobs: - run: name: Upload APK to GitHub Releases command: | - python tools/upload-binaries.py -t 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 -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH + #python tools/upload-binaries.py -t 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 -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - ./bin/linux/amd64/github-release upload \ --user EduardoMunozGomez \ From 01f3b23bea6ece00faf16ae179455776fadb6ccb Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Mon, 15 May 2023 20:17:50 -0600 Subject: [PATCH 26/27] Condition to add a subtype=background to the commander deck --- projects/mtg/src/GameStateDeckViewer.cpp | 2 +- projects/mtg/src/MTGDeck.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/mtg/src/GameStateDeckViewer.cpp b/projects/mtg/src/GameStateDeckViewer.cpp index 45ee8491f..c8f7600c6 100644 --- a/projects/mtg/src/GameStateDeckViewer.cpp +++ b/projects/mtg/src/GameStateDeckViewer.cpp @@ -413,7 +413,7 @@ void GameStateDeckViewer::choiceAddRemove(MTGCard * card) if(!card->data->hasType("Dungeon")){ sbMenu->Add(SBMENU_ADD_NORMAL, "Add to Deck"); sbMenu->Add(SBMENU_ADD_SB, "Add to Sideboard"); - if(card->data->hasType("Legendary") && (card->data->hasType("Creature") || card->data->basicAbilities[Constants::CANBECOMMANDER])) + if(card->data->hasType("Legendary") && (card->data->hasType("Creature") || card->data->basicAbilities[Constants::CANBECOMMANDER] || card->data->hasType("Background"))) sbMenu->Add(SBMENU_ADD_CMD, "Choose as Commander"); } else sbMenu->Add(SBMENU_ADD_DNG, "Add to Dungeons"); diff --git a/projects/mtg/src/MTGDeck.cpp b/projects/mtg/src/MTGDeck.cpp index 1af10acd4..1180f45d2 100644 --- a/projects/mtg/src/MTGDeck.cpp +++ b/projects/mtg/src/MTGDeck.cpp @@ -993,12 +993,12 @@ MTGDeck::MTGDeck(const string& config_file, MTGAllCards * _allcards, int meta_on while (it != s.end() && std::isdigit(*it)) ++it; if(!s.empty() && it == s.end()){ MTGCard * newcard = database->getCardById(atoi(s.c_str())); - if(!CommandZone.size() && newcard->data->hasType("Legendary") && (newcard->data->hasType("Creature") || newcard->data->basicAbilities[Constants::CANBECOMMANDER])) // If no commander has been added you can add one. + if(!CommandZone.size() && newcard->data->hasType("Legendary") && (newcard->data->hasType("Creature") || newcard->data->basicAbilities[Constants::CANBECOMMANDER] || newcard->data->hasType("Background"))) // If no commander has been added you can add one. CommandZone.push_back(s); else if(CommandZone.size() == 1 && newcard->data->hasType("Legendary") && (newcard->data->hasType("Creature") || newcard->data->basicAbilities[Constants::CANBECOMMANDER])){ // If a commander has been added you can add a new one just if both have partner ability of if one can choose a Background. if(newcard && (newcard->data->basicAbilities[Constants::PARTNER] || newcard->data->basicAbilities[Constants::BACKGROUNDPARTNER])){ MTGCard * oldcard = database->getCardById(atoi((CommandZone.at(0)).c_str())); - if((oldcard && oldcard->data->hasType(Subtypes::TYPE_BACKGROUND) && (oldcard->data->name != newcard->data->name)) || (oldcard && oldcard->data->basicAbilities[Constants::PARTNER] && (oldcard->data->name != newcard->data->name) && ((oldcard->data->partner == "" && newcard->data->partner == "") || (oldcard->data->partner == newcard->data->name && newcard->data->partner == oldcard->data->name)))) + if((oldcard && oldcard->data->hasType("Background") && (oldcard->data->name != newcard->data->name)) || (oldcard && oldcard->data->basicAbilities[Constants::PARTNER] && (oldcard->data->name != newcard->data->name) && ((oldcard->data->partner == "" && newcard->data->partner == "") || (oldcard->data->partner == newcard->data->name && newcard->data->partner == oldcard->data->name)))) CommandZone.push_back(s); } } @@ -1010,12 +1010,12 @@ MTGDeck::MTGDeck(const string& config_file, MTGAllCards * _allcards, int meta_on if (newcard){ std::stringstream str_id; str_id << newcard->getId(); - if(!CommandZone.size() && newcard->data->hasType("Legendary") && (newcard->data->hasType("Creature") || newcard->data->basicAbilities[Constants::CANBECOMMANDER])) // If no commander has been added you can add one. + if(!CommandZone.size() && newcard->data->hasType("Legendary") && (newcard->data->hasType("Creature") || newcard->data->basicAbilities[Constants::CANBECOMMANDER] || newcard->data->hasType("Background"))) // If no commander has been added you can add one. CommandZone.push_back(str_id.str()); - else if(CommandZone.size() == 1 && newcard->data->hasType("Legendary") && (newcard->data->hasType("Creature") || newcard->data->basicAbilities[Constants::CANBECOMMANDER])){ // If a commander has been added you can add a new one just if both have partner ability of if one can choose a Background. + else if(CommandZone.size() == 1 && newcard->data->hasType("Legendary") && (newcard->data->hasType("Creature") || newcard->data->basicAbilities[Constants::CANBECOMMANDER] || newcard->data->hasType("Background"))){ // If a commander has been added you can add a new one just if both have partner ability of if one can choose a Background. if(newcard && (newcard->data->basicAbilities[Constants::PARTNER] || newcard->data->basicAbilities[Constants::BACKGROUNDPARTNER])){ MTGCard * oldcard = database->getCardById(atoi((CommandZone.at(0)).c_str())); - if((oldcard && oldcard->data->hasType(Subtypes::TYPE_BACKGROUND) && (oldcard->data->name != newcard->data->name)) || (oldcard && oldcard->data->basicAbilities[Constants::PARTNER] && (oldcard->data->name != newcard->data->name) && ((oldcard->data->partner == "" && newcard->data->partner == "") || (oldcard->data->partner == newcard->data->name && newcard->data->partner == oldcard->data->name)))) + if((oldcard && oldcard->data->hasType("Background") && (oldcard->data->name != newcard->data->name)) || (oldcard && oldcard->data->basicAbilities[Constants::PARTNER] && (oldcard->data->name != newcard->data->name) && ((oldcard->data->partner == "" && newcard->data->partner == "") || (oldcard->data->partner == newcard->data->name && newcard->data->partner == oldcard->data->name)))) CommandZone.push_back(str_id.str()); } } From fa50c2f5dfa090d5a8ff2ff427162e04ff8cd7b6 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Mon, 15 May 2023 20:34:00 -0600 Subject: [PATCH 27/27] Temporal --- .circleci/config.yml | 66 ------------------------------------------ tools/circle-script.sh | 42 --------------------------- 2 files changed, 108 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 tools/circle-script.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 31f100a01..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,66 +0,0 @@ -version: 2.1 -jobs: - build: - working_directory: ~/project - docker: - - image: circleci/openjdk:8-jdk - environment: - - BUILD_ANDROID=YES - parallelism: 2 - steps: - - checkout - - run: - name: Install Dependencies - command: | - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg - echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list - sudo apt-get update - sudo apt-get -qq install wget unzip libgd-dev libc6-i386 lib32stdc++6 lib32gcc-s1 lib32ncurses6 lib32z1 jq ant lib32ncurses6 libgd-dev - - wget https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip -nv - wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz -nv - - - run: - name: Setup Android - command: | - export ANDROID="android-sdk-linux/tools/android" - export PATH="$PATH:$ANDROID_HOME/tools" - unzip android-ndk-r22-linux-x86_64.zip - tar -zxf android-sdk_r24.4.1-linux.tgz - $ANDROID list sdk --extended -a && - echo yes | $ANDROID update sdk -a -t tools,platform-tools,build-tools-23.0.1,android-23 --no-ui --force --no-https - sudo apt-get install openjdk-11-jdk - export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 - export PATH=$JAVA_HOME/bin:$PATH - - - run: - name: Build Android - command: | - echo $PWD - bash ./tools/circle-script.sh - - - run: - name: Install Required Packages - command: | - sudo apt-get update - sudo apt-get install -y curl python3-pip bzip2 - curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - - sudo pip install --upgrade pip - sudo pip install setuptools-rust - sudo pip install pyOpenSSL - sudo pip install pyjavaproperties - sudo pip install github3.py - sudo pip install cpp-coveralls - - - run: - name: Upload APK to GitHub Releases - command: | - #python tools/upload-binaries.py -t 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 -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH - curl -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - - ./bin/linux/amd64/github-release upload \ - --user EduardoMunozGomez \ - --repo wagic \ - --tag circle \ - --name Wagic-debug.apk \ - --file projects/mtg/Android/bin/Wagic-debug.apk \ diff --git a/tools/circle-script.sh b/tools/circle-script.sh deleted file mode 100644 index 7d187fd5e..000000000 --- a/tools/circle-script.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -e - -# let's dump some info to debug a bit -echo ls = `ls` -echo pwd = `pwd` -# computing potential release name -echo CIRCLE_PR_NUMBER = $CIRCLE_PR_NUMBER -echo CIRCLE_BRANCH = $CIRCLE_BRANCH - -if [ -z "$CIRCLE_PR_NUMBER" ]; then - if [ "$CIRCLE_BRANCH" = "alphas" ]; then - export RELEASE_NAME="alpha-${CIRCLE_BUILD_NUM}" - elif [ "$CIRCLE_BRANCH" = "master" ]; then - export RELEASE_NAME="latest-master" - fi -fi - -echo RELEASE_NAME = $RELEASE_NAME - - -# updating versions with the CIRCLE build numbers -cd projects/mtg/ -ant update > error.txt -cd ../.. - -# we create resource package -if [ "$BUILD_RES" = "YES" ] || [ "$BUILD_PSP" = "YES" ]; then - cd projects/mtg/bin/Res - python createResourceZip.py - # if we let the zip here, Wagic will use it in the testsuite - # and we'll get 51 failed test cases - mv core_*.zip ../../../../core.zip - cd ../../../.. -fi - -# we're building an Android binary here -if [ "$BUILD_ANDROID" = "YES" ]; then - android-ndk-r22/ndk-build -C projects/mtg/Android -j4 - android-sdk-linux/tools/android list targets - android-sdk-linux/tools/android update project -t 1 -p projects/mtg/Android - ant debug -f projects/mtg/Android/build.xml -fi