From abc361faf0259be881501f0921dbdf99b1d93fa9 Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 00:01:07 -0400 Subject: [PATCH 01/12] Hello! Testing from the gitea instance owned by ProfessorFartsalot~ --- Test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Test.txt diff --git a/Test.txt b/Test.txt new file mode 100644 index 0000000..e69de29 From 3280446c7e875e970b1223f7a03de2c73f006cf0 Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 01:35:49 -0400 Subject: [PATCH 02/12] Create build.yml --- .gitea/workflows/build.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitea/workflows/build.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..05e844e --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,39 @@ +name: .NET Build + +on: + push: + branches: ['*'] + pull_request: + branches: ['*'] + +jobs: + build: + runs-on: self-hosted # Uses your custom runner + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + + - name: Restore .NET dependencies + run: dotnet restore + + - name: Download Dalamud + run: | + mkdir -p "$HOME/.local/share/XIVLauncher/addon/Hooks/dev" + wget https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -O latest.zip + unzip -o latest.zip -d "$HOME/.local/share/XIVLauncher/addon/Hooks/dev/" + + - name: Build project + run: dotnet build --no-restore --configuration Release --nologo + + - name: Publish Windows executable + run: dotnet publish -c Release -r win-x64 --self-contained true -o ./publish + + - name: Archive published files + run: zip -r SnowcloakClient.zip ./publish/* + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + path: ./publish/* From 3dde713c915d4b36642023be476e705597e8e775 Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 01:58:27 -0400 Subject: [PATCH 03/12] Fix build issues? --- .gitea/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 05e844e..7dede4f 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -8,7 +8,9 @@ on: jobs: build: - runs-on: self-hosted # Uses your custom runner + runs-on: self-hosted + container: + image: gitea_runner_dotnet_node:latest steps: - name: Checkout repository uses: actions/checkout@v4 From c428f306ca9668cbbdbebf65409db93c77a03464 Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 02:07:22 -0400 Subject: [PATCH 04/12] NOW fix build issues??? --- .gitea/workflows/build.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 7dede4f..8aef1cf 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -2,29 +2,25 @@ name: .NET Build on: push: - branches: ['*'] + branches: '*' pull_request: - branches: ['*'] jobs: build: runs-on: self-hosted - container: - image: gitea_runner_dotnet_node:latest steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: true - - name: Restore .NET dependencies run: dotnet restore - name: Download Dalamud run: | - mkdir -p "$HOME/.local/share/XIVLauncher/addon/Hooks/dev" - wget https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -O latest.zip - unzip -o latest.zip -d "$HOME/.local/share/XIVLauncher/addon/Hooks/dev/" + mkdir -p $HOME/.xlcore/dalamud/Hooks/dev/ + curl -L https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -o latest.zip + unzip -o latest.zip -d $HOME/.xlcore/dalamud/Hooks/dev/ - name: Build project run: dotnet build --no-restore --configuration Release --nologo From 2be5f5d3207d9e620a5b99379465b12f5c6cffa7 Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 02:19:45 -0400 Subject: [PATCH 05/12] MAYBE NOW IT WORKS? --- .gitea/workflows/build.yml | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 8aef1cf..4af1591 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -1,4 +1,4 @@ -name: .NET Build +name: .NET Build and Publish to Gitea on: push: @@ -13,7 +13,11 @@ jobs: uses: actions/checkout@v4 with: submodules: true - - name: Restore .NET dependencies + + - name: Verify .NET installation + run: dotnet --version + + - name: Restore dependencies run: dotnet restore - name: Download Dalamud @@ -25,13 +29,33 @@ jobs: - name: Build project run: dotnet build --no-restore --configuration Release --nologo - - name: Publish Windows executable - run: dotnet publish -c Release -r win-x64 --self-contained true -o ./publish + - name: Publish Windows self-contained executable + run: | + dotnet publish MareSynchronos.csproj \ + -c Release \ + -r win-x64 \ + --self-contained true \ + -o ./publish - name: Archive published files run: zip -r SnowcloakClient.zip ./publish/* - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - path: ./publish/* + - name: Create Gitea release + env: + GITEA_TOKEN: ${{ secrets.build_snowcloak_client }} + run: | + API_URL="https://imbuilding.anuke.org/api/v1/repos/owner/repo/releases" + TAG="v$(date +%Y%m%d%H%M)" + # Create release + RELEASE_ID=$(curl -s -X POST \ + -H "Content-Type: application/json" \ + -H "Authorization: token $GITEA_TOKEN" \ + -d "{\"tag_name\":\"$TAG\",\"name\":\"Automated Build $TAG\",\"body\":\"Automated build artifact\"}" \ + $API_URL | jq -r '.id') + echo "Release ID: $RELEASE_ID" + # Upload asset + curl -s -X POST \ + -H "Authorization: token $GITEA_TOKEN" \ + -F "name=SnowcloakClient.zip" \ + -F "attachment=@SnowcloakClient.zip" \ + "$API_URL/$RELEASE_ID/assets" From 4c8ce23e8a6479fdf727bd2f4c7a51cdd98d02a8 Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 02:22:22 -0400 Subject: [PATCH 06/12] Update build.yml --- .gitea/workflows/build.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 4af1591..fa70614 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -13,10 +13,6 @@ jobs: uses: actions/checkout@v4 with: submodules: true - - - name: Verify .NET installation - run: dotnet --version - - name: Restore dependencies run: dotnet restore @@ -29,13 +25,8 @@ jobs: - name: Build project run: dotnet build --no-restore --configuration Release --nologo - - name: Publish Windows self-contained executable - run: | - dotnet publish MareSynchronos.csproj \ - -c Release \ - -r win-x64 \ - --self-contained true \ - -o ./publish + - name: Publish Windows executable + run: dotnet publish -c Release -r win-x64 --self-contained true -o ./publish - name: Archive published files run: zip -r SnowcloakClient.zip ./publish/* From 5de9ad3a541b6de725c1bfd015740aeed70bf838 Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 02:27:15 -0400 Subject: [PATCH 07/12] Update build.yml --- .gitea/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index fa70614..5bd0761 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -33,9 +33,9 @@ jobs: - name: Create Gitea release env: - GITEA_TOKEN: ${{ secrets.build_snowcloak_client }} + GITEA_TOKEN: ${{ secrets.BUILD_SNOWCLOAK_CLIENT }} run: | - API_URL="https://imbuilding.anuke.org/api/v1/repos/owner/repo/releases" + API_URL="https://imbuilding.anuke.org/api/v1/repos/ProfessorFartsalot/repo/releases" TAG="v$(date +%Y%m%d%H%M)" # Create release RELEASE_ID=$(curl -s -X POST \ From ba852831aa25191c3815d886fe1531ec340e4518 Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 02:31:18 -0400 Subject: [PATCH 08/12] Update build.yml --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 5bd0761..6c1103a 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -35,7 +35,7 @@ jobs: env: GITEA_TOKEN: ${{ secrets.BUILD_SNOWCLOAK_CLIENT }} run: | - API_URL="https://imbuilding.anuke.org/api/v1/repos/ProfessorFartsalot/repo/releases" + API_URL="https://imbuilding.anuke.org/api/v1/repos/ProfessorFartsalot/SnowcloakClient/releases" TAG="v$(date +%Y%m%d%H%M)" # Create release RELEASE_ID=$(curl -s -X POST \ From abea8f0856ce2d25a7aefff82599abc685a2b83e Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 14:13:16 -0400 Subject: [PATCH 09/12] Fix PNG images being limited to 255px --- MareSynchronos/Utils/PngHdr.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/MareSynchronos/Utils/PngHdr.cs b/MareSynchronos/Utils/PngHdr.cs index 5723f5a..16631b8 100644 --- a/MareSynchronos/Utils/PngHdr.cs +++ b/MareSynchronos/Utils/PngHdr.cs @@ -20,7 +20,7 @@ public class PngHdr stream.ReadExactly(buffer[..8]); - uint ihdrLength = BitConverter.ToUInt32(buffer); + uint ihdrLength = ReadBigEndianUInt32(buffer[..4]); // The next four bytes will be the length of the IHDR section (it should be 13 bytes but we only need 8) if (ihdrLength < 8) @@ -32,8 +32,8 @@ public class PngHdr stream.ReadExactly(buffer[..8]); - uint width = BitConverter.ToUInt32(buffer); - uint height = BitConverter.ToUInt32(buffer[4..]); + uint width = ReadBigEndianUInt32(buffer[..4]); + uint height = ReadBigEndianUInt32(buffer[4..8]); // Validate the width/height are non-negative and... that's all we care about! if (width > int.MaxValue || height > int.MaxValue) @@ -46,4 +46,12 @@ public class PngHdr return InvalidSize; } } -} + // Minimal helper for big-endian conversion + private static uint ReadBigEndianUInt32(ReadOnlySpan bytes) + { + return ((uint)bytes[0] << 24) | + ((uint)bytes[1] << 16) | + ((uint)bytes[2] << 8) | + bytes[3]; + } +} \ No newline at end of file From da6623741c830b0a1f1e887fa453098fa76c6b0b Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 14:16:53 -0400 Subject: [PATCH 10/12] Delete test file used yesterday for testing purposes --- Test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Test.txt diff --git a/Test.txt b/Test.txt deleted file mode 100644 index e69de29..0000000 From a3dfe35df62a8d2c38267542c32553d2e6f2c9e3 Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 14:18:20 -0400 Subject: [PATCH 11/12] Add initial build script --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 6c1103a..8f28bbb 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -35,7 +35,7 @@ jobs: env: GITEA_TOKEN: ${{ secrets.BUILD_SNOWCLOAK_CLIENT }} run: | - API_URL="https://imbuilding.anuke.org/api/v1/repos/ProfessorFartsalot/SnowcloakClient/releases" + API_URL="https://git.snowcloak-sync.com/api/v1/repos/Eauldane/SnowcloakClient/releases" TAG="v$(date +%Y%m%d%H%M)" # Create release RELEASE_ID=$(curl -s -X POST \ From d2212da456b31a12e4a27aeaecdc511775242a7e Mon Sep 17 00:00:00 2001 From: Professor Fartsalot Date: Sun, 31 Aug 2025 14:20:16 -0400 Subject: [PATCH 12/12] Switch from testing to production build tag --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 8f28bbb..93837ff 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -7,7 +7,7 @@ on: jobs: build: - runs-on: self-hosted + runs-on: dotnet steps: - name: Checkout repository uses: actions/checkout@v4