Skip to content
Open
Show file tree
Hide file tree
Changes from 119 commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
8d4d835
[email protected]
StephenHodgson May 2, 2025
a270b59
refactor cert handling
StephenHodgson May 2, 2025
0fb219c
add certificate-password input
StephenHodgson May 2, 2025
b0e337f
remove unused method
StephenHodgson May 2, 2025
0b52d2f
Update src/index.ts
StephenHodgson May 2, 2025
391968e
crs
StephenHodgson May 2, 2025
fdd0f7b
disable concurrency
StephenHodgson May 2, 2025
3721766
updated dependencies
StephenHodgson May 18, 2025
7e03259
add package format
StephenHodgson Jul 18, 2025
9b3097a
expand tests
StephenHodgson Jul 18, 2025
5a75d34
specify windows sdk
StephenHodgson Jul 18, 2025
01552d1
remove comment
StephenHodgson Jul 18, 2025
89394fb
tweaks and fixes
StephenHodgson Jul 18, 2025
45b827a
set unity arch
StephenHodgson Jul 18, 2025
17e8cfb
set subtarget
StephenHodgson Jul 18, 2025
6c1b126
set windows sdk
StephenHodgson Jul 18, 2025
10d4d73
explicit vs versions
StephenHodgson Jul 18, 2025
15ebac7
tweaks
StephenHodgson Jul 18, 2025
d330004
try something new
StephenHodgson Jul 18, 2025
ef1286e
fix
StephenHodgson Jul 18, 2025
e8c031a
fix file permissions
StephenHodgson Jul 18, 2025
16c887c
fix names
StephenHodgson Jul 18, 2025
486967e
quotes
StephenHodgson Jul 18, 2025
568ec2b
idk
StephenHodgson Jul 18, 2025
a51a06f
add strategy
StephenHodgson Jul 18, 2025
d2a97cf
remove strategy
StephenHodgson Jul 18, 2025
46a484e
format
StephenHodgson Jul 18, 2025
b123707
same same but different
StephenHodgson Jul 18, 2025
a372c43
update matrix logic
StephenHodgson Jul 18, 2025
2c78ca0
fix json array join
StephenHodgson Jul 18, 2025
b0806af
pretty print?
StephenHodgson Jul 18, 2025
6803f5c
update strategy
StephenHodgson Jul 18, 2025
622a80d
quote me
StephenHodgson Jul 18, 2025
0922a95
remove wrapper
StephenHodgson Jul 18, 2025
8db2625
fix
StephenHodgson Jul 18, 2025
601f7d6
tweak
StephenHodgson Jul 18, 2025
8dd0e00
idk
StephenHodgson Jul 18, 2025
78b593f
refactor again
StephenHodgson Jul 18, 2025
55e8654
update excludes
StephenHodgson Jul 18, 2025
e114368
revert
StephenHodgson Jul 18, 2025
1dd59e4
remove excludes
StephenHodgson Jul 18, 2025
2ca65e9
reorder
StephenHodgson Jul 18, 2025
ba5f125
add some logging
StephenHodgson Jul 18, 2025
19f1b31
tweak
StephenHodgson Jul 18, 2025
e5e3306
its already in json
StephenHodgson Jul 18, 2025
5c20854
remove matrix
StephenHodgson Jul 18, 2025
b50ade6
fix
StephenHodgson Jul 18, 2025
5bab3a5
don't be so nice to fall back. throw an error
StephenHodgson Jul 18, 2025
d65f4d4
debugging
StephenHodgson Jul 18, 2025
8100ed1
more infos
StephenHodgson Jul 18, 2025
d711483
fix artifacts
StephenHodgson Jul 18, 2025
5d46aaf
only build 2021 to speed things up
StephenHodgson Jul 18, 2025
03ad03a
update excludes
StephenHodgson Jul 18, 2025
819cc53
update signature check
StephenHodgson Jul 18, 2025
d59b931
remove the dups
StephenHodgson Jul 18, 2025
93c2cdc
give me what I want
StephenHodgson Jul 18, 2025
edf7310
version with changeset
StephenHodgson Jul 19, 2025
bc85f75
fix reading var
StephenHodgson Jul 19, 2025
4228ff2
add /p:UseMsixTool=false
StephenHodgson Jul 19, 2025
146cea2
remove package format
StephenHodgson Jul 19, 2025
e53a15e
change how we find executable
StephenHodgson Jul 19, 2025
12a3428
group by version
StephenHodgson Jul 19, 2025
dfbae8d
drop
StephenHodgson Jul 19, 2025
e457061
remove top level array
StephenHodgson Jul 19, 2025
43b8171
compact
StephenHodgson Jul 19, 2025
5253c74
hmm
StephenHodgson Jul 19, 2025
acf07c3
use job builder
StephenHodgson Jul 19, 2025
11df653
permissions
StephenHodgson Jul 19, 2025
1df4e99
more permissions
StephenHodgson Jul 19, 2025
842966b
show csproj info
StephenHodgson Jul 19, 2025
503b89b
remove globber
StephenHodgson Jul 19, 2025
1c0bf73
fix typo
StephenHodgson Jul 19, 2025
8d23c5a
upload build artifacts
StephenHodgson Jul 19, 2025
67cb52f
setup unity build cache
StephenHodgson Jul 19, 2025
c01d058
remove dup
StephenHodgson Jul 19, 2025
ec065f9
list build output dir
StephenHodgson Jul 19, 2025
e792e23
test dir exists
StephenHodgson Jul 19, 2025
2fbe90b
fix path
StephenHodgson Jul 19, 2025
2d1ec73
update cache actions
StephenHodgson Jul 19, 2025
b36a7fd
rename cache step id
StephenHodgson Jul 19, 2025
663eb14
update workflow
StephenHodgson Jul 19, 2025
8670ac7
no cache
StephenHodgson Jul 19, 2025
b0ad4e1
add input `publisher-display-name`
StephenHodgson Jul 22, 2025
691ca9e
Revert "add input `publisher-display-name`"
StephenHodgson Jul 22, 2025
3bd01c9
refactor all the things
StephenHodgson Jul 23, 2025
371e185
remove semver
StephenHodgson Jul 23, 2025
1cc187c
recursive search
StephenHodgson Jul 23, 2025
932b448
remove package format in action yaml
StephenHodgson Jul 23, 2025
69e0d80
don't fail if we don't find
StephenHodgson Jul 23, 2025
66a0945
bump major to v2
StephenHodgson Jul 23, 2025
73652f4
fix output directory path
StephenHodgson Jul 23, 2025
4e1f9ac
find app packages
StephenHodgson Jul 23, 2025
5e62c04
try different globber
StephenHodgson Jul 23, 2025
a0e23ed
remove `architecture` input
StephenHodgson Jul 23, 2025
ccb3767
format
StephenHodgson Jul 23, 2025
f7b80f3
quotes
StephenHodgson Jul 23, 2025
51e6d41
refactor
StephenHodgson Jul 23, 2025
af9e9b3
revert
StephenHodgson Jul 23, 2025
1578ffe
fix var
StephenHodgson Jul 23, 2025
3e29b7d
update cert validation
StephenHodgson Jul 23, 2025
dd6124f
allValid is true until it isn't
StephenHodgson Jul 23, 2025
7f74f9d
add `store-association-path` input
StephenHodgson Jul 23, 2025
edb79ca
update info
StephenHodgson Jul 23, 2025
ec7ee75
update vcxproj lookup
StephenHodgson Jul 24, 2025
9f1c7c7
log
StephenHodgson Jul 24, 2025
2a37b11
update logging and vcxproj lookup
StephenHodgson Jul 24, 2025
9205c29
updated logging
StephenHodgson Jul 24, 2025
a0adf2c
update vsxproj lookup
StephenHodgson Jul 24, 2025
c4b04ff
print contents
StephenHodgson Jul 24, 2025
7d1bcc9
file name
StephenHodgson Jul 24, 2025
128ffa4
regex
StephenHodgson Jul 24, 2025
17c5a68
patch up appx correctly
StephenHodgson Jul 24, 2025
a90ed21
fix tag
StephenHodgson Jul 24, 2025
c67b432
regex for display name update in appxpackage
StephenHodgson Jul 24, 2025
8beea03
use reservedNameMatch
StephenHodgson Jul 25, 2025
65e0762
docs
StephenHodgson Jul 25, 2025
1046bd1
update regex
StephenHodgson Jul 25, 2025
71667fb
print contents
StephenHodgson Jul 25, 2025
f4703cc
update var name
StephenHodgson Jul 25, 2025
a3ee6a2
refactor
StephenHodgson Jul 25, 2025
ba99e7e
.
StephenHodgson Jul 25, 2025
96be129
remove access check before copy
StephenHodgson Jul 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/build-options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"os": [
"windows-latest"
],
"build-target": [
"WSAPlayer"
],
"unity-version": [
"6000.0.49f1 (840e0a9776d9)"
],
"uwp-arch": [
"x64",
"ARM64"
],
"uwp-subtarget": [
"PC",
"HoloLens"
],
"uwp-package-type": [
"sideload",
"upload"
],
"certificate-type": [
"default",
"custom"
],
"windows-sdk-version": [
"10.0.22621.0",
"10.0.26100.0"
],
"exclude": [
{
"uwp-package-type": "upload",
"certificate-type": "custom"
},
{
"uwp-subtarget": "PC",
"uwp-arch": "ARM64"
},
{
"uwp-subtarget": "HoloLens",
"uwp-arch": "x64"
}
]
}
204 changes: 204 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
name: build
permissions:
contents: read
on:
workflow_call:
inputs:
matrix:
required: true
type: string
secrets:
UNITY_USERNAME:
required: true
UNITY_PASSWORD:
required: true
jobs:
build:
name: ${{ matrix.name }}
strategy:
matrix: ${{ fromJSON(inputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.os }}
permissions:
contents: read
env:
BUILD_OUTPUT_PATH: ${{ github.workspace }}/Builds/${{ matrix.build-target }}
TEMPLATE_PATH: ''
UNITY_PROJECT_PATH: '' # set by unity-setup action
steps:
- uses: actions/checkout@v4
- run: 'npm install -g openupm-cli'
- uses: buildalon/unity-setup@v1
with:
version-file: 'None'
build-targets: ${{ matrix.build-target }}
unity-version: ${{ matrix.unity-version }}
- name: Find Unity Template Path
run: |
$rootPath = $env:UNITY_EDITOR_PATH -replace "Editor.*", ""
Write-Host "ROOT_PATH=$rootPath"
$templatePath = Get-ChildItem -Recurse -Filter "com.unity.template.3d*.tgz" -Path $rootPath | Select-Object -First 1 | Select-Object -ExpandProperty FullName
Write-Host "TEMPLATE_PATH=$templatePath"
echo "TEMPLATE_PATH=$templatePath" >> $env:GITHUB_ENV
$projectPath = "${{ github.workspace }}/Test Project"
echo "UNITY_PROJECT_PATH=$projectPath" >> $env:GITHUB_ENV
shell: pwsh
- uses: buildalon/activate-unity-license@v1
with:
license: 'Personal'
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
- uses: buildalon/unity-action@v1
name: Create Test Project
with:
log-name: 'create-test-project'
args: '-quit -nographics -batchmode -createProject "${{ env.UNITY_PROJECT_PATH }}" -cloneFromTemplate "${{ env.TEMPLATE_PATH }}"'
- run: 'openupm add com.virtualmaker.buildalon'
name: Add Build Pipeline Package
working-directory: ${{ env.UNITY_PROJECT_PATH }}
- uses: buildalon/unity-action@v1
name: '${{ matrix.build-target }}-Validate'
with:
build-target: ${{ matrix.build-target }}
log-name: '${{ matrix.build-target }}-Validate'
args: '-quit -nographics -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset'
- uses: buildalon/unity-action@v1
name: '${{ matrix.build-target }}-Build'
with:
build-target: ${{ matrix.build-target }}
log-name: '${{ matrix.build-target }}-Build'
args: '-quit -nographics -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -buildOutputDirectory ${{ env.BUILD_OUTPUT_PATH }} -sceneList Assets/Scenes/SampleScene.unity -arch ${{ matrix.uwp-arch }} -wsaSubtarget ${{ matrix.uwp-subtarget }} -wsaUWPSDK ${{ matrix.windows-sdk-version }}'
- name: Enumerate Build Directory
shell: bash
run: |
if [ -z "${{ env.BUILD_OUTPUT_PATH }}" ]; then
echo "::error::Failed to find build output path!"
exit 1
fi
if [ ! -d "${{ env.BUILD_OUTPUT_PATH }}" ]; then
echo "::error::Build output directory does not exist: ${{ env.BUILD_OUTPUT_PATH }}"
exit 1
fi
echo "::group::Build Artifacts"
ls -R "${{ env.BUILD_OUTPUT_PATH }}"
echo "::endgroup::"
- uses: microsoft/setup-msbuild@v2
with:
vs-version: '[15.0, )'
- name: Create Test Certificate
if: matrix.certificate-type == 'custom'
shell: pwsh
run: |
$certPath = "${{ github.workspace }}/TestCert.pfx"
$certPassword = "TestPassword123"

# Create a self-signed certificate for testing
$cert = New-SelfSignedCertificate -Type Custom -Subject "CN=TestPublisher" -KeyUsage DigitalSignature -FriendlyName "Test UWP Certificate" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}")

# Export the certificate to a PFX file
$pwd = ConvertTo-SecureString -String $certPassword -Force -AsPlainText
Export-PfxCertificate -cert "Cert:\CurrentUser\My\$($cert.Thumbprint)" -FilePath $certPath -Password $pwd

# Import the certificate into Trusted Root Certification Authorities so it is trusted for validation
Import-PfxCertificate -FilePath $certPath -CertStoreLocation "Cert:\LocalMachine\Root" -Password $pwd | Out-Null
Write-Host "Test certificate imported to Trusted Root Certification Authorities."

Write-Host "Test certificate created at: $certPath"
- uses: ./ # buildalon/unity-uwp-builder
id: uwp-build
with:
platform: ${{ matrix.uwp-arch }}
project-path: ${{ env.BUILD_OUTPUT_PATH }}
package-type: ${{ matrix.uwp-package-type }}
certificate-path: ${{ matrix.certificate-type == 'custom' && format('{0}/TestCert.pfx', github.workspace) || '' }}
certificate-password: ${{ matrix.certificate-type == 'custom' && 'TestPassword123' || '' }}
windows-sdk-version: ${{ matrix.windows-sdk-version }}
- name: Validate Outputs
shell: bash
run: |
set -e
OUTPUT_DIR="${{ steps.uwp-build.outputs.output-directory }}"
if [ -z "${OUTPUT_DIR}" ]; then
echo "❌ No output directory found at ${OUTPUT_DIR}"
else
echo "✅ Output Directory: ${OUTPUT_DIR}"
fi

ls -R "${OUTPUT_DIR}"
- name: Validate Certificate Usage
if: matrix.certificate-type == 'custom' && matrix.uwp-package-type == 'sideload'
shell: pwsh
run: |
$output_dir="${{ steps.uwp-build.outputs.output-directory }}"

if (-not (Test-Path $output_dir)) {
Write-Host "❌ Output directory does not exist: $output_dir"
exit 1
}

# get .appx, .appxbundle, .appxupload, .msix, .msixbundle, .msixupload files
$bundles = Get-ChildItem -Path $output_dir -Recurse -Include *.appx, *.appxbundle, *.appxupload, *.msix, *.msixbundle, *.msixupload | Select-Object -ExpandProperty FullName
if ($bundles.Count -eq 0) {
Write-Host "❌ No bundles found in output directory: $output_dir"
exit 1
}

$allValid = $true

foreach ($bundle in $bundles) {
# Skip Microsoft dependency packages
if ($bundle -match "Microsoft\.VCLibs\..*\.appx$") {
Write-Host "⏭️ Skipping Microsoft dependency package: $bundle"
continue
}

Write-Host "::group::🔍 Validating certificate for bundle: $bundle"

if (-not (Test-Path $bundle)) {
Write-Host "❌ Bundle not found: $bundle"
Write-Host "::endgroup::"
$allValid = $false
continue
}

$signature = Get-AuthenticodeSignature -FilePath $bundle
if ($signature.Status -eq "Valid") {
Write-Host "✅ Bundle is properly signed"
Write-Host "📜 Certificate Subject: $($signature.SignerCertificate.Subject)"
Write-Host "👤 Certificate Issuer: $($signature.SignerCertificate.Issuer)"
Write-Host "📅 Certificate Valid From: $($signature.SignerCertificate.NotBefore)"
Write-Host "📅 Certificate Valid To: $($signature.SignerCertificate.NotAfter)"
Write-Host "🔑 Certificate Thumbprint: $($signature.SignerCertificate.Thumbprint)"

if ($signature.SignerCertificate.Subject -like "*TestPublisher*") {
Write-Host "✅✅ Confirmed: Custom test certificate was used successfully!"
} else {
Write-Host "❌ Warning: Certificate subject doesn't match expected test certificate"
$allValid = $false
}
} elseif ($signature.Status -eq "NotSigned") {
Write-Host "❌ Bundle is not signed"
$allValid = $false
} else {
Write-Host "❌ Bundle signature status: $($signature.Status)"
$allValid = $false
}

Write-Host "📝 Signature details: $($signature.StatusMessage)"
Write-Host "::endgroup::"
}
if (-not $allValid) {
Write-Host "❌ One or more bundles failed certificate validation."
exit 1
} else {
Write-Host "✅ All bundles passed certificate validation."
}
- uses: actions/upload-artifact@v4
if: always() || cancelled()
with:
retention-days: 1
overwrite: true
name: ${{ matrix.unity-version }} ${{ matrix.name }}
path: |
${{ github.workspace }}/**/*.log
${{ env.BUILD_OUTPUT_PATH }}
15 changes: 15 additions & 0 deletions .github/workflows/update-release-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Update Release Tags
on:
push:
tags: ['*']
workflow_dispatch:
jobs:
update-release-tags:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: RageAgainstThePixel/update-action-release-tags@v1
109 changes: 25 additions & 84 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,38 @@
name: validate
on:
push:
branches:
- 'main'
branches: ['main']
pull_request:
branches:
- '*'
# Allows you to run this workflow manually from the Actions tab
branches: ['*']
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unity-build:
name: '(${{ matrix.unity-version }}) ${{ matrix.build-target }} - ${{ matrix.uwp-package-type }}'
env:
TEMPLATE_PATH: ''
UNITY_PROJECT_PATH: '' # set by unity-setup action
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
build-target: [WSAPlayer]
unity-version: [2021.x, 2022.x, 6000.x]
uwp-package-type: [sideload, upload]
setup:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- run: 'npm install -g openupm-cli'
# Installs the Unity Editor based on your project version text file
# sets -> env.UNITY_EDITOR_PATH
# sets -> env.UNITY_PROJECT_PATH
- uses: buildalon/unity-setup@v1
with:
version-file: 'None'
build-targets: ${{ matrix.build-target }}
unity-version: ${{ matrix.unity-version }}
- name: Find Unity Template Path
run: |
$rootPath = $env:UNITY_EDITOR_PATH -replace "Editor.*", ""
Write-Host "ROOT_PATH=$rootPath"
$templatePath = Get-ChildItem -Recurse -Filter "com.unity.template.3d*.tgz" -Path $rootPath | Select-Object -First 1 | Select-Object -ExpandProperty FullName
Write-Host "TEMPLATE_PATH=$templatePath"
echo "TEMPLATE_PATH=$templatePath" >> $env:GITHUB_ENV
$projectPath = "${{ github.workspace }}/Test Project"
echo "UNITY_PROJECT_PATH=$projectPath" >> $env:GITHUB_ENV
shell: pwsh
# Activates the installation with the provided credentials
- uses: buildalon/activate-unity-license@v1
with:
license: 'Personal'
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
- uses: buildalon/unity-action@v1
name: Create Test Project
with:
log-name: 'create-test-project'
args: '-quit -nographics -batchmode -createProject "${{ env.UNITY_PROJECT_PATH }}" -cloneFromTemplate "${{ env.TEMPLATE_PATH }}"'
- run: 'openupm add com.virtualmaker.buildalon'
name: Add Build Pipeline Package
working-directory: ${{ env.UNITY_PROJECT_PATH }}
- uses: buildalon/unity-action@v1
name: '${{ matrix.build-target }}-Validate'
with:
build-target: ${{ matrix.build-target }}
log-name: '${{ matrix.build-target }}-Validate'
args: '-quit -nographics -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset'
- uses: buildalon/unity-action@v1
name: '${{ matrix.build-target }}-Build'
sparse-checkout: .github/
- uses: RageAgainstThePixel/job-builder@v1
id: setup-jobs
with:
build-target: ${{ matrix.build-target }}
log-name: '${{ matrix.build-target }}-Build'
args: '-quit -nographics -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity -arch ARM64'
- uses: microsoft/setup-msbuild@v2

# builds visual studio project for UWP and packages it as an appx
- uses: ./ # buildalon/unity-uwp-builder
id: uwp-build
with:
project-path: ${{ env.UNITY_PROJECT_PATH }}/Builds/WSAPlayer
package-type: ${{ matrix.uwp-package-type }}

- name: print outputs
shell: bash
run: |
echo "Executable: ${{ steps.uwp-build.outputs.executable }}"
echo "Output Directory: ${{ steps.uwp-build.outputs.output-directory }}"
ls -R "${{ steps.uwp-build.outputs.output-directory }}"

- uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ${{ github.run_number }}.${{ github.run_attempt }} ${{ matrix.unity-version }}-${{ matrix.build-target }}-${{ matrix.uwp-package-type }}
path: |
${{ github.workspace }}/**/*.log
${{ steps.uwp-build.outputs.output-directory }}
build-options: ./.github/workflows/build-options.json
group-by: 'unity-version'
outputs:
jobs: ${{ steps.setup-jobs.outputs.jobs }}
validate:
if: ${{ needs.setup.outputs.jobs }}
needs: setup
name: ${{ matrix.jobs.name }}
permissions:
contents: read
strategy:
matrix: ${{ fromJSON(needs.setup.outputs.jobs) }}
secrets: inherit
uses: ./.github/workflows/build.yml
with:
matrix: ${{ toJSON(matrix.jobs.matrix) }}
Loading