From 2a3f5bc5dbf86872737ce2ce965261991b3b79f0 Mon Sep 17 00:00:00 2001
From: EliteMasterEric <ericmyllyoja@gmail.com>
Date: Mon, 9 Oct 2023 12:02:19 -0400
Subject: [PATCH 1/6] Added Git Hooks

---
 .github/hooks/README.md     | 5 +++++
 .github/hooks/post-checkout | 2 ++
 .github/hooks/post-merge    | 2 ++
 .github/hooks/pre-push      | 5 +++++
 4 files changed, 14 insertions(+)
 create mode 100644 .github/hooks/README.md
 create mode 100644 .github/hooks/post-checkout
 create mode 100644 .github/hooks/post-merge
 create mode 100644 .github/hooks/pre-push

diff --git a/.github/hooks/README.md b/.github/hooks/README.md
new file mode 100644
index 000000000..544fbf365
--- /dev/null
+++ b/.github/hooks/README.md
@@ -0,0 +1,5 @@
+# Git Hooks
+These work even on Windows because of Git Bash.
+
+## Setup
+`git config core.hooksPath .github/hooks`
diff --git a/.github/hooks/post-checkout b/.github/hooks/post-checkout
new file mode 100644
index 000000000..12358c998
--- /dev/null
+++ b/.github/hooks/post-checkout
@@ -0,0 +1,2 @@
+#!/bin/sh
+git submodule update --init --recursive
diff --git a/.github/hooks/post-merge b/.github/hooks/post-merge
new file mode 100644
index 000000000..12358c998
--- /dev/null
+++ b/.github/hooks/post-merge
@@ -0,0 +1,2 @@
+#!/bin/sh
+git submodule update --init --recursive
diff --git a/.github/hooks/pre-push b/.github/hooks/pre-push
new file mode 100644
index 000000000..ec4c820ac
--- /dev/null
+++ b/.github/hooks/pre-push
@@ -0,0 +1,5 @@
+#!/bin/sh
+if git diff --cached --submodule | grep -q "^+"; then
+  echo "WARNING: You have unpushed changes in submodules."
+  exit 1
+fi

From 1462d90a3538eb49792faacc3477176be9cd3a47 Mon Sep 17 00:00:00 2001
From: EliteMasterEric <ericmyllyoja@gmail.com>
Date: Mon, 9 Oct 2023 12:12:31 -0400
Subject: [PATCH 2/6] Disable unit test suite on Actions until we can figure
 out what's up.

---
 .github/workflows/build-shit.yml | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml
index 0e365b281..3ce0d538b 100644
--- a/.github/workflows/build-shit.yml
+++ b/.github/workflows/build-shit.yml
@@ -61,19 +61,19 @@ jobs:
           butler-key: ${{ secrets.BUTLER_API_KEY}}
           build-dir: export/release/windows/bin
           target: win
-  test-unit-win:
-    needs: create-nightly-win
-    runs-on: windows-latest
-    permissions:
-       contents: write
-       actions: write
-    steps:
-      - uses: actions/checkout@v3
-        with:
-          submodules: 'recursive'
-          token: ${{ secrets.GH_RO_PAT }}
-      - uses: ./.github/actions/setup-haxeshit
-      - name: Run unit tests
-        run: |
-          cd ./tests/unit/
-          ./start-win-native.bat
+#  test-unit-win:
+#    needs: create-nightly-win
+#    runs-on: windows-latest
+#    permissions:
+#       contents: write
+#       actions: write
+#    steps:
+#      - uses: actions/checkout@v3
+#        with:
+#          submodules: 'recursive'
+#          token: ${{ secrets.GH_RO_PAT }}
+#      - uses: ./.github/actions/setup-haxeshit
+#      - name: Run unit tests
+#        run: |
+#          cd ./tests/unit/
+#          ./start-win-native.bat

From 9a762e1129ebc059d9b6a8ced4250cce4f483ccd Mon Sep 17 00:00:00 2001
From: Hazel <git@ravy.org>
Date: Mon, 9 Oct 2023 18:38:31 +0100
Subject: [PATCH 3/6] switch from GITHUB_REF to GITHUB_REF_NAME

---
 .github/actions/upload-itch/action.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/actions/upload-itch/action.yml b/.github/actions/upload-itch/action.yml
index 5abc31b16..7a4b45427 100644
--- a/.github/actions/upload-itch/action.yml
+++ b/.github/actions/upload-itch/action.yml
@@ -36,9 +36,9 @@ runs:
           ./butler -V
         shell: bash
       - name: Upload game to itch.io
-        env: 
+        env:
           BUTLER_API_KEY: ${{inputs.butler-key}}
         run: |
           ./butler login
-          ./butler push ${{inputs.build-dir}} ninja-muffin24/funkin-secret:${{inputs.target}}-${GITHUB_REF##*/}
-        shell: bash
\ No newline at end of file
+          ./butler push ${{inputs.build-dir}} ninja-muffin24/funkin-secret:${{inputs.target}}-${GITHUB_REF_NAME}
+        shell: bash

From 3e1e5d330cadefb125d0ea53eeafe7f147b662de Mon Sep 17 00:00:00 2001
From: Hazel <git@ravy.org>
Date: Mon, 9 Oct 2023 19:39:11 +0100
Subject: [PATCH 4/6] ci: hxcpp + export caching

---
 .github/actions/setup-haxeshit/action.yml |  1 -
 .github/workflows/build-shit.yml          | 19 ++++++++++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/.github/actions/setup-haxeshit/action.yml b/.github/actions/setup-haxeshit/action.yml
index 756530178..0cc544cf7 100644
--- a/.github/actions/setup-haxeshit/action.yml
+++ b/.github/actions/setup-haxeshit/action.yml
@@ -25,7 +25,6 @@ runs:
         key: ${{ runner.os }}-hmm-${{ hashFiles('**/hmm.json') }}
         restore-keys: |
           ${{ runner.os }}-hmm-
-          ${{ runner.os }}-
     - if: ${{ steps.cache-hmm.outputs.cache-hit != 'true' }}
       name: hmm install
       run: |
diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml
index 3ce0d538b..92d915a8e 100644
--- a/.github/workflows/build-shit.yml
+++ b/.github/workflows/build-shit.yml
@@ -52,13 +52,30 @@ jobs:
           submodules: 'recursive'
           token: ${{ secrets.GH_RO_PAT }}
       - uses: ./.github/actions/setup-haxeshit
+      - name: Make HXCPP cache dir
+        shell: bash
+        run: |
+          mkdir -p ${{ runner.temp }}/hxcpp_cache
+      - name: Restore build cache
+        id: cache-build-win
+        uses: actions/cache@v3
+        with:
+          path: |
+            .haxelib
+            export
+            ${{ runner.temp }}/hxcpp_cache
+          key: ${{ runner.os }}-build-win-${{ github.ref_name }}
+          restore-keys: |
+            ${{ runner.os }}-build-win-
       - name: Build game
         run: |
           haxelib run lime build windows -release -DNO_REDIRECT_ASSETS_FOLDER
           dir
+        env:
+          HXCPP_COMPILE_CACHE: "${{ runner.temp }}/hxcpp_cache"
       - uses: ./.github/actions/upload-itch
         with:
-          butler-key: ${{ secrets.BUTLER_API_KEY}}
+          butler-key: ${{ secrets.BUTLER_API_KEY }}
           build-dir: export/release/windows/bin
           target: win
 #  test-unit-win:

From 9c13095cb4dd2bee114b84aa16ec67e2cf3f2b6b Mon Sep 17 00:00:00 2001
From: Hazel <git@ravy.org>
Date: Mon, 9 Oct 2023 20:38:30 +0100
Subject: [PATCH 5/6] trigger ci event to see if caching worked


From db563a4967ffdf618836496966d90d7a08b0964e Mon Sep 17 00:00:00 2001
From: Hazel <git@ravy.org>
Date: Mon, 9 Oct 2023 21:03:49 +0100
Subject: [PATCH 6/6] hotfix: windows style paths

---
 .github/workflows/build-shit.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml
index 92d915a8e..809a8b94b 100644
--- a/.github/workflows/build-shit.yml
+++ b/.github/workflows/build-shit.yml
@@ -55,7 +55,7 @@ jobs:
       - name: Make HXCPP cache dir
         shell: bash
         run: |
-          mkdir -p ${{ runner.temp }}/hxcpp_cache
+          mkdir -p ${{ runner.temp }}\\hxcpp_cache
       - name: Restore build cache
         id: cache-build-win
         uses: actions/cache@v3
@@ -63,7 +63,7 @@ jobs:
           path: |
             .haxelib
             export
-            ${{ runner.temp }}/hxcpp_cache
+            ${{ runner.temp }}\\hxcpp_cache
           key: ${{ runner.os }}-build-win-${{ github.ref_name }}
           restore-keys: |
             ${{ runner.os }}-build-win-
@@ -72,7 +72,7 @@ jobs:
           haxelib run lime build windows -release -DNO_REDIRECT_ASSETS_FOLDER
           dir
         env:
-          HXCPP_COMPILE_CACHE: "${{ runner.temp }}/hxcpp_cache"
+          HXCPP_COMPILE_CACHE: "${{ runner.temp }}\\hxcpp_cache"
       - uses: ./.github/actions/upload-itch
         with:
           butler-key: ${{ secrets.BUTLER_API_KEY }}