From 82d61a0acdec72df5007f0b8b8495b2ef27f5fdc Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 12 Nov 2024 15:20:05 +0100 Subject: [PATCH 1/9] Fix a file reference --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02fa315..7053972 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,4 +72,4 @@ jobs: run: | echo "#define gitsha \"${{ github.sha }}\"" > workflow.cpp mkdir build - python ./fa-python-binary-patcher/main.py "$(pwd)" clang++ ld g++ + python ./fa-python-binary-patcher/main.py "./fa-binary-patches" clang++ ld g++ From 07dd0ff07469719492c3985b0a553fa71c64d9dc Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 12 Nov 2024 15:23:42 +0100 Subject: [PATCH 2/9] Add debug code --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7053972..f85602c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,6 +70,8 @@ jobs: # patch it, if it works then we're good - name: Patch base executable run: | - echo "#define gitsha \"${{ github.sha }}\"" > workflow.cpp + ls ./fa-binary-patches + ls ./fa-python-binary-patcher + echo "#define gitsha \"${{ github.sha }}\"" > "./fa-binary-patchesworkflow.cpp" mkdir build python ./fa-python-binary-patcher/main.py "./fa-binary-patches" clang++ ld g++ From 72b7bc207b9f08400bc69e6f776cb1d04f6b76de Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 12 Nov 2024 15:28:29 +0100 Subject: [PATCH 3/9] Move the executable --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f85602c..ef4ce8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,13 +65,15 @@ jobs: # download base executable - name: Download base executable - run: curl -L "https://content.faforever.com/build/ForgedAlliance_base.exe" -o ForgedAlliance_base.exe + run: | + curl -L "https://content.faforever.com/build/ForgedAlliance_base.exe" -o ForgedAlliance_base.exe + mv ForgedAlliance_base.exe ./fa-binary-patches/ForgedAlliance_base.exe # patch it, if it works then we're good - name: Patch base executable run: | ls ./fa-binary-patches ls ./fa-python-binary-patcher - echo "#define gitsha \"${{ github.sha }}\"" > "./fa-binary-patchesworkflow.cpp" + echo "#define gitsha \"${{ github.sha }}\"" > "./fa-binary-patches/workflow.cpp" mkdir build python ./fa-python-binary-patcher/main.py "./fa-binary-patches" clang++ ld g++ From 4ee8563c7ed003af5b2068f4550ce3b58a224e83 Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 12 Nov 2024 15:32:55 +0100 Subject: [PATCH 4/9] Store patches in the root --- .github/workflows/test.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef4ce8f..dc6a0f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,12 +41,12 @@ jobs: # clone everything that we need - uses: actions/checkout@v4 with: - path: fa-python-binary-patcher + repository: FAForever/FA-Binary-Patches + path: . - uses: actions/checkout@v4 with: - repository: FAForever/FA-Binary-Patches - path: fa-binary-patches + path: fa-python-binary-patcher # install everything that we need - uses: actions/setup-python@v5 @@ -67,13 +67,12 @@ jobs: - name: Download base executable run: | curl -L "https://content.faforever.com/build/ForgedAlliance_base.exe" -o ForgedAlliance_base.exe - mv ForgedAlliance_base.exe ./fa-binary-patches/ForgedAlliance_base.exe # patch it, if it works then we're good - name: Patch base executable run: | - ls ./fa-binary-patches + ls ./. ls ./fa-python-binary-patcher - echo "#define gitsha \"${{ github.sha }}\"" > "./fa-binary-patches/workflow.cpp" + echo "#define gitsha \"${{ github.sha }}\"" > "./workflow.cpp" mkdir build - python ./fa-python-binary-patcher/main.py "./fa-binary-patches" clang++ ld g++ + python ./fa-python-binary-patcher/main.py "$(pwd)" clang++ ld g++ From 30ebfe424ba4ddb2fd4435bb04a9c6c1e3c746da Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 12 Nov 2024 15:40:11 +0100 Subject: [PATCH 5/9] Fix a typo --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc6a0f1..5831284 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,7 @@ jobs: - uses: actions/checkout@v4 with: repository: FAForever/FA-Binary-Patches + ref: 'master' path: . - uses: actions/checkout@v4 @@ -73,6 +74,6 @@ jobs: run: | ls ./. ls ./fa-python-binary-patcher - echo "#define gitsha \"${{ github.sha }}\"" > "./workflow.cpp" + echo "#define gitsha "\"${{ github.sha }}\"" > "./workflow.cpp" mkdir build python ./fa-python-binary-patcher/main.py "$(pwd)" clang++ ld g++ From e6094390ba442b74c2c0a3bde626d27166d112ff Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 12 Nov 2024 15:43:46 +0100 Subject: [PATCH 6/9] Fix the echo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5831284..47eef1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,6 +74,6 @@ jobs: run: | ls ./. ls ./fa-python-binary-patcher - echo "#define gitsha "\"${{ github.sha }}\"" > "./workflow.cpp" + echo "#define gitsha \"${{ github.sha }}\"" > workflow.cpp mkdir build python ./fa-python-binary-patcher/main.py "$(pwd)" clang++ ld g++ From 811a1982b5e34d82ce44d9e7dba4ff6114abfd81 Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 12 Nov 2024 15:47:19 +0100 Subject: [PATCH 7/9] Use `'` instead of `"` --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 47eef1b..9e459eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,6 +74,6 @@ jobs: run: | ls ./. ls ./fa-python-binary-patcher - echo "#define gitsha \"${{ github.sha }}\"" > workflow.cpp + echo '#define gitsha "${{ github.sha }}"' > workflow.cpp mkdir build python ./fa-python-binary-patcher/main.py "$(pwd)" clang++ ld g++ From 13daf0c1d64176a18319024ee65b05c01cb4a902 Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 12 Nov 2024 15:49:26 +0100 Subject: [PATCH 8/9] Remove debugging code --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e459eb..3cf7446 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,8 +72,6 @@ jobs: # patch it, if it works then we're good - name: Patch base executable run: | - ls ./. - ls ./fa-python-binary-patcher echo '#define gitsha "${{ github.sha }}"' > workflow.cpp mkdir build python ./fa-python-binary-patcher/main.py "$(pwd)" clang++ ld g++ From db51e1d49facbb8f8fa933a346ececdba3574a4f Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 12 Nov 2024 15:50:14 +0100 Subject: [PATCH 9/9] Remove re-creating of `workflow.cpp` as it makes no sense in this context --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3cf7446..5d55479 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,6 +72,5 @@ jobs: # patch it, if it works then we're good - name: Patch base executable run: | - echo '#define gitsha "${{ github.sha }}"' > workflow.cpp mkdir build python ./fa-python-binary-patcher/main.py "$(pwd)" clang++ ld g++