From 6f1df5ec8c490e2a0e9cf43138d6a6f8d86c178d Mon Sep 17 00:00:00 2001
From: Brandon Grimshaw
Date: Mon, 13 Oct 2025 11:38:13 +1000
Subject: [PATCH 1/6] Add automated build via github actions
---
.github/workflows/.build.yml | 42 ++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 .github/workflows/.build.yml
diff --git a/.github/workflows/.build.yml b/.github/workflows/.build.yml
new file mode 100644
index 0000000..3cabd59
--- /dev/null
+++ b/.github/workflows/.build.yml
@@ -0,0 +1,42 @@
+name: Build UnityDataTool
+
+on: workflow_dispatch
+
+jobs:
+ build:
+ runs-on: ${{ matrix.os }}-latest
+
+ strategy:
+ matrix:
+ os: [windows, macos]
+ arch: [x64, arm64]
+ environment: [debug, release]
+ exclude:
+ - os: windows
+ arch: arm64
+ - os: macos
+ arch: x64
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 9.0.x
+
+ - name: Publish UnityDataTool (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.environment }})
+ run: >
+ dotnet publish UnityDataTool
+ -c Release
+ -a ${{ matrix.arch }}
+ -p:PublishSingleFile=true
+ -p:UseAppHost=true
+ -o publish/${{ matrix.arch }}
+
+ - name: Upload artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: UnityDataTool-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.environment }}
+ path: publish/${{ matrix.os }}/${{ matrix.arch }}-${{ matrix.environment }}
From a709ae6501dcf5da6b9ff04f67e995124ad843a4 Mon Sep 17 00:00:00 2001
From: Brandon Grimshaw
Date: Mon, 13 Oct 2025 12:03:30 +1000
Subject: [PATCH 2/6] Fix publish command to use matrix context
---
.github/workflows/.build.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/.build.yml b/.github/workflows/.build.yml
index 3cabd59..5993640 100644
--- a/.github/workflows/.build.yml
+++ b/.github/workflows/.build.yml
@@ -29,11 +29,11 @@ jobs:
- name: Publish UnityDataTool (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.environment }})
run: >
dotnet publish UnityDataTool
- -c Release
+ -c ${{ matrix.environment }}
-a ${{ matrix.arch }}
-p:PublishSingleFile=true
-p:UseAppHost=true
- -o publish/${{ matrix.arch }}
+ -o publish/${{ matrix.os }}/${{ matrix.arch }}-${{ matrix.environment }}
- name: Upload artifact
uses: actions/upload-artifact@v4
From dbf9b28d4180e21594f2c6ac3bb5fb58d792e3a4 Mon Sep 17 00:00:00 2001
From: Brandon Grimshaw
Date: Mon, 13 Oct 2025 12:03:52 +1000
Subject: [PATCH 3/6] Add publish folder to .gitignore
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index aa59e68..399c91d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
[Tt]emp/
[Ll]og/
[Ll]ogs/
+[Pp]ublish/
**/*.csproj.user
**/*.suo
From 14078e952a42b16c63c30958c98c2f310a86d8e6 Mon Sep 17 00:00:00 2001
From: Brandon Grimshaw
Date: Mon, 13 Oct 2025 12:43:02 +1000
Subject: [PATCH 4/6] Add build trigger for pushes to main
---
.github/workflows/.build.yml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/.build.yml b/.github/workflows/.build.yml
index 5993640..f8fecc6 100644
--- a/.github/workflows/.build.yml
+++ b/.github/workflows/.build.yml
@@ -1,6 +1,10 @@
name: Build UnityDataTool
-on: workflow_dispatch
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
jobs:
build:
From 852fb85a98138a38df837a5e01e5235ed93929ee Mon Sep 17 00:00:00 2001
From: Brandon Grimshaw
Date: Mon, 13 Oct 2025 13:02:14 +1000
Subject: [PATCH 5/6] Move build environment var from matrix to
workflow_dispatch inputs
This allows only building release builds for auto-builds from `main`,
while allowing manual builds to be debug (when desired).
---
.github/workflows/.build.yml | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/.build.yml b/.github/workflows/.build.yml
index f8fecc6..9e7d76e 100644
--- a/.github/workflows/.build.yml
+++ b/.github/workflows/.build.yml
@@ -2,25 +2,35 @@ name: Build UnityDataTool
on:
workflow_dispatch:
+ inputs:
+ environment:
+ description: 'Build environment'
+ default: 'release'
+ required: true
+ options:
+ - debug
+ - release
push:
branches:
- main
+env:
+ environment: ${{ inputs.environment || 'release' }}
+
jobs:
build:
- runs-on: ${{ matrix.os }}-latest
-
strategy:
matrix:
os: [windows, macos]
arch: [x64, arm64]
- environment: [debug, release]
exclude:
- os: windows
arch: arm64
- os: macos
arch: x64
+ runs-on: ${{ matrix.os }}-latest
+
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -30,17 +40,17 @@ jobs:
with:
dotnet-version: 9.0.x
- - name: Publish UnityDataTool (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.environment }})
+ - name: Publish UnityDataTool (${{ matrix.os }}-${{ matrix.arch }}-${{ env.environment }})
run: >
dotnet publish UnityDataTool
- -c ${{ matrix.environment }}
+ -c ${{ env.environment }}
-a ${{ matrix.arch }}
-p:PublishSingleFile=true
-p:UseAppHost=true
- -o publish/${{ matrix.os }}/${{ matrix.arch }}-${{ matrix.environment }}
+ -o publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
- name: UnityDataTool-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.environment }}
- path: publish/${{ matrix.os }}/${{ matrix.arch }}-${{ matrix.environment }}
+ name: UnityDataTool-${{ matrix.os }}-${{ matrix.arch }}-${{ env.environment }}
+ path: publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}
From 2a4489c5dc70abe8e7828c66f3e0f4d33455f221 Mon Sep 17 00:00:00 2001
From: Brandon Grimshaw
Date: Mon, 13 Oct 2025 13:12:14 +1000
Subject: [PATCH 6/6] Fix environment input type for manual dispatches
---
.github/workflows/.build.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/.build.yml b/.github/workflows/.build.yml
index 9e7d76e..9f2bdcf 100644
--- a/.github/workflows/.build.yml
+++ b/.github/workflows/.build.yml
@@ -7,6 +7,7 @@ on:
description: 'Build environment'
default: 'release'
required: true
+ type: choice
options:
- debug
- release