Skip to content

Commit 1664db1

Browse files
authored
Update GitHub Actions (#996)
* Update validation_mrtk3.yaml * Update update-versions.ps1 * Update pack-upm.ps1 * Create upm.yaml Update upm.yaml * Update upm.yaml * Update upm.yaml * Update upm.yaml * Update upm.yaml Update upm.yaml * Fix detected issues Update validatecode.ps1 * Delete upm.yaml * Delete issue_labeler.yaml * Update pr_labeler.yaml
1 parent 244576a commit 1664db1

File tree

9 files changed

+46
-71
lines changed

9 files changed

+46
-71
lines changed

.github/workflows/issue_labeler.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/pr_labeler.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ jobs:
1414
- uses: actions/github-script@v6
1515
with:
1616
script: |
17-
if (context.payload.pull_request.base.ref == 'mrtk3')
17+
if (context.payload.pull_request.base.ref == 'feature/XRI3')
1818
{
1919
github.rest.issues.addLabels({
2020
issue_number: context.issue.number,
2121
owner: context.repo.owner,
2222
repo: context.repo.repo,
23-
labels: ['MRTK3']
23+
labels: ['Branch: feature/XRI3']
2424
})
2525
}
2626
27-
// When we switch the repo to MRTK3, we'll have to edit this.
27+
// When we switch the repo to XRI3, we'll have to edit this.
2828
if (context.payload.pull_request.base.ref == 'main')
2929
{
3030
github.rest.issues.addLabels({
3131
issue_number: context.issue.number,
3232
owner: context.repo.owner,
3333
repo: context.repo.repo,
34-
labels: ['MRTK2']
34+
labels: ['Branch: main']
3535
})
36-
}
36+
}

.github/workflows/validation_mrtk3.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: Code Validation (MRTK3)
1+
name: Code Validation
22

33
on:
44
push:
5-
branches: ["mrtk3"]
5+
branches:
6+
- main
7+
- 'feature/*'
68
pull_request:
7-
branches: ["mrtk3"]
89

910
jobs:
1011
validation:

Pipelines/Scripts/pack-upm.ps1

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
.PARAMETER PrereleaseTag
1414
The tag to append after the version (e.g. "build", "internal" or "prerelease"). Leave blank for a release build.
1515
.PARAMETER Revision
16-
The revision number for the build, to append after the release labal and suffix.
16+
The revision number for the build, to append after the release label and suffix.
1717
.PARAMETER BuildNumber
1818
The fourth digit for the full version number for assembly versioning. This is the build number.
19-
2019
#>
2120
param(
2221
[Parameter(Mandatory = $true)]
@@ -39,16 +38,16 @@ if (-not (Test-Path $OutputDirectory -PathType Container)) {
3938
$OutputDirectory = Resolve-Path -Path $OutputDirectory
4039

4140
Write-Host ""
42-
Write-Host -ForegroundColor Blue "======================================="
41+
Write-Host -ForegroundColor Blue "======================================="
4342
Write-Host -ForegroundColor Blue "Packing All Packages"
44-
Write-Host -ForegroundColor Blue "======================================="
43+
Write-Host -ForegroundColor Blue "======================================="
4544
Write-Host "OutputDirectory: $OutputDirectory"
4645

4746
try {
4847
Push-Location $OutputDirectory
4948

5049
# Update package versions
51-
. $PSScriptRoot\update-versions.ps1 -PackagesRoot $ProjectRoot -PrereleaseTag $PrereleaseTag -Revision $Revision -BuildNumber $BuildNumber
50+
. $PSScriptRoot\update-versions.ps1 -PackagesRoot $ProjectRoot -PrereleaseTag $PrereleaseTag -Revision $Revision -BuildNumber $BuildNumber
5251

5352
# Loop through package directories and copy documentation
5453
Get-ChildItem -Path $ProjectRoot/*/package.json | ForEach-Object {
@@ -63,32 +62,32 @@ try {
6362
$docFolder = "$packagePath/Documentation~"
6463

6564
Write-Host ""
66-
Write-Host -ForegroundColor Green "======================================="
65+
Write-Host -ForegroundColor Green "======================================="
6766
Write-Host -ForegroundColor Green "Copying Documentation~"
68-
Write-Host -ForegroundColor Green "======================================="
67+
Write-Host -ForegroundColor Green "======================================="
6968
Write-Host "Package name: $packageName"
7069

7170
if (Test-Path -Path $docFolder) {
7271
Copy-Item -Path "$ProjectRoot/Pipelines/UPM/Documentation~/*" -Destination $docFolder -Recurse
7372
}
7473
else {
7574
Copy-Item -Path "$ProjectRoot/Pipelines/UPM/Documentation~" -Destination $docFolder -Recurse
76-
}
75+
}
7776
}
7877

7978
# Package the package directories
8079
Get-ChildItem -Path $ProjectRoot/*/package.json | ForEach-Object {
8180
$currentPackageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+(\.\w+)*" -Path $_ | Select-Object -First 1
82-
81+
8382
if (-not $currentPackageName) {
8483
return # this is not an MRTK package, so skip
8584
}
8685

8786
Write-Host ""
88-
Write-Host -ForegroundColor Green "======================================="
87+
Write-Host -ForegroundColor Green "======================================="
8988
Write-Host -ForegroundColor Green "Packing Package"
9089
Write-Host -ForegroundColor Green "======================================="
91-
Write-Host "Package name: $currentPackageName"
90+
Write-Host "Package name: $currentPackageName"
9291

9392
$currentPackageName = $currentPackageName.Matches[0].Value
9493
$packageFriendlyName = (Select-String -Pattern "`"displayName`": `"(.+)`"" -Path $_ | Select-Object -First 1).Matches.Groups[1].Value
@@ -102,7 +101,7 @@ try {
102101
# clean up
103102
if (Test-Path -Path $docFolder) {
104103
Write-Host "Cleaning up Documentation~ from $packageFriendlyName"
105-
# A documentation folder was created. Remove it.
104+
# A documentation folder was created. Remove it.
106105
Remove-Item -Path $docFolder -Recurse -Force
107106

108107
# But restore anything that's checked-in.
@@ -118,8 +117,8 @@ try {
118117
}
119118

120119
Write-Host ""
121-
Write-Host -ForegroundColor Blue "======================================="
122-
Write-Host -ForegroundColor Blue "Successfully Packed All Pacakges"
120+
Write-Host -ForegroundColor Blue "======================================="
121+
Write-Host -ForegroundColor Blue "Successfully Packed All Packages"
123122
Write-Host -ForegroundColor Blue "======================================="
124123
Write-Host ""
125124
}

Pipelines/Scripts/update-versions.ps1

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
.SYNOPSIS
66
Updates the version of the UPM packages in the project with a release label, revision, and build number.
77
.DESCRIPTION
8-
The script will update the version of the package.json file with the new version label and revision number. This
8+
The script will update the version of the package.json file with the new version label and revision number. This
99
script will also update the AssemblyInfo.cs file with the new version number and build number. Finally, this
1010
script will update the CHANGELOG.md file with the new version number and release date.
1111
.PARAMETER PackagesRoot
1212
The root folder containing the packages.
1313
.PARAMETER PrereleaseTag
1414
The tag to append after the version (e.g. "build", "internal" or "prerelease"). Leave blank for a release build.
1515
.PARAMETER Revision
16-
The revision number for the build, to append after the release labal.
16+
The revision number for the build, to append after the release label.
1717
.PARAMETER BuildNumber
1818
The fourth digit for the full version number for assembly versioning. This is the build number.
1919
#>
@@ -44,7 +44,7 @@ if (-not [string]::IsNullOrEmpty($Revision)) {
4444
}
4545

4646
Write-Host ""
47-
Write-Host -ForegroundColor Green "======================================="
47+
Write-Host -ForegroundColor Green "======================================="
4848
Write-Host -ForegroundColor Green "Updating All Package Versions"
4949
Write-Host -ForegroundColor Green "======================================="
5050
Write-Output "Project root: $PackagesRoot"
@@ -63,7 +63,7 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje
6363

6464
# Test is package name starts with org.mixedrealitytoolkit to verify it's an MRTK package
6565
if ($packageName -notmatch "^org\.mixedrealitytoolkit\.\w+(\.\w+)*") {
66-
return
66+
return
6767
}
6868

6969
# Read the version value
@@ -73,24 +73,24 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje
7373
$packagePath = $_.Directory
7474

7575
Write-Host ""
76-
Write-Host -ForegroundColor Green "======================================="
76+
Write-Host -ForegroundColor Green "======================================="
7777
Write-Host -ForegroundColor Green "Updating Package Version"
78-
Write-Host -ForegroundColor Green "======================================="
78+
Write-Host -ForegroundColor Green "======================================="
7979
Write-Output "Package name: $packageName"
8080

8181
# This regex will match the a valid version is the package.json file. Some examples of valid versions are:
8282
#
8383
# 1.0.0
8484
# 1.0.0-pre.1
8585
# 1.0.0-development.pre.1
86-
# 1.0.0-development
86+
# 1.0.0-development
8787
#
88-
# In these example "development" is the prerelease tag and "pre.1" is the meta tag.
88+
# In these example "development" is the prerelease tag and "pre.1" is the meta tag.
8989
$validVersion = $version -match '(?<version>[0-9.]+)(-((?<prereleaseTag>[a-zA-Z0-9]*)?(?=(|\.[a-zA-Z]*\.[0-9]*)(\.[0-9]{6}\.[0-9]|$))|)((?(?<=-)|\.)(?<metaTag>[a-zA-Z][a-zA-Z0-9]*)\.(?<metaTagVersion>[1-9][0-9]*))?)?'
9090
if (-not $validVersion) {
9191
throw "Failed to parse version out of the package.json file at $($_.FullName)"
9292
}
93-
93+
9494
# Get the version parts from the $Matches variable, and verify that the version key exists.
9595
$versionParts = $Matches
9696
if (-not $versionParts.ContainsKey('version')) {
@@ -102,14 +102,14 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje
102102

103103
# Get all tag parts to append to the version
104104
$tagParts = @()
105-
105+
106106
# Add the new version label if it's not empty
107107
if (-not [string]::IsNullOrEmpty($PrereleaseTag)) {
108108
$tagParts += $PrereleaseTag
109109
}
110110

111111
# Add the optional metatag tag and version if found in match
112-
if ($versionParts.ContainsKey('metaTag') -and $versionParts.ContainsKey('metaTagVersion')) {
112+
if ($versionParts.ContainsKey('metaTag') -and $versionParts.ContainsKey('metaTagVersion')) {
113113
$tagParts += $versionParts['metaTag']
114114
$tagParts += $versionParts['metaTagVersion']
115115
}
@@ -125,7 +125,7 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje
125125
$tag = "-" + $tag
126126
}
127127

128-
# Update the version with the new tag
128+
# Update the version with the new tag
129129
$jsonContent.version = "$version$tag"
130130

131131
# Write json content back to the file
@@ -153,18 +153,18 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje
153153
$assemblyInfo += "[assembly: AssemblyInformationalVersion(`"$version$tag`")]`r`n"
154154
}
155155

156-
Set-Content -Path $_ -Value $assemblyInfo -NoNewline
156+
Set-Content -Path $_ -Value $assemblyInfo -NoNewline
157157
}
158158

159159
# Update the CHANGELOG.md file with the new version and release date
160160
Write-Output "Patching CHANGELOG.md version to [$version$tag] - $year-$month-$day"
161-
Get-ChildItem -Path $packagePath/CHANGELOG.md -Recurse | ForEach-Object {
161+
Get-ChildItem -Path $packagePath/CHANGELOG.md -Recurse | ForEach-Object {
162162
(Get-Content -Path $_ -Raw) -Replace "## \[$version(-[a-zA-Z0-9.]+)?\] - \b\d{4}\b-\b(0[1-9]|1[0-2])\b-\b(0[1-9]|[12][0-9]|3[01])\b", "## [$version$tag] - $year-$month-$day" | Set-Content -Path $_ -NoNewline
163163
}
164164
}
165165

166166
Write-Host ""
167-
Write-Host -ForegroundColor Green "======================================="
167+
Write-Host -ForegroundColor Green "======================================="
168168
Write-Host -ForegroundColor Green "Successfully Updated Package Versions"
169169
Write-Host -ForegroundColor Green "======================================="
170170
Write-Host ""

Pipelines/Scripts/validatecode.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ function IsNamespace {
221221
[string]$Line
222222
)
223223
process {
224-
if (($Line -match "^namespace\sMicrosoft\.MixedReality\.Toolkit") -or
225-
($Line -match "^namespace\sMicrosoft\.Windows\.MixedReality")) {
224+
if ($Line -match "^namespace\sMixedReality\.Toolkit") {
226225
$true;
227226
}
228227
$false;
@@ -247,7 +246,8 @@ function GetProjectRelativePath {
247246
$normalizedFileName = $FileName.Replace("\", "/")
248247
if ($Directory.EndsWith("/")) {
249248
$substringLength = $Directory.Length
250-
} else {
249+
}
250+
else {
251251
$substringLength = $Directory.Length + 1
252252
}
253253
$assetFileName = $normalizedFileName.SubString($substringLength)
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Mixed Reality Toolkit Contributors
22
// Licensed under the BSD 3-Clause
33

4-
using UnityEngine;
5-
64
namespace MixedReality.Toolkit.Input
75
{
86
public class ProximityEnteredEventArgs : BaseProximityEventArgs
@@ -13,7 +11,7 @@ public class ProximityEnteredEventArgs : BaseProximityEventArgs
1311
/// <param name="nearInteractionModeDetector">NearInteractionModeDetector that triggers proximity entered event.</param>
1412
public ProximityEnteredEventArgs(NearInteractionModeDetector nearInteractionModeDetector) : base(nearInteractionModeDetector)
1513
{
16-
//Empty on purpose
14+
// Empty on purpose
1715
}
1816
}
1917
}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Mixed Reality Toolkit Contributors
22
// Licensed under the BSD 3-Clause
33

4-
using UnityEngine;
5-
64
namespace MixedReality.Toolkit.Input
75
{
86
public class ProximityExitedEventArgs : BaseProximityEventArgs
@@ -13,7 +11,7 @@ public class ProximityExitedEventArgs : BaseProximityEventArgs
1311
/// <param name="nearInteractionModeDetector">NearInteractionModeDetector that triggers proximity exited event.</param>
1412
public ProximityExitedEventArgs(NearInteractionModeDetector nearInteractionModeDetector) : base(nearInteractionModeDetector)
1513
{
16-
//Empty on purpose
14+
// Empty on purpose
1715
}
1816
}
1917
}

org.mixedrealitytoolkit.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ public IEnumerator TestSimpleEmptyButtonHasSeeItSayItLabelComponentAndReferenced
924924
yield return null;
925925

926926
SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleEmptyButton.GetComponents<SeeItSayItLabelEnabler>();
927-
Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); //Check it has the component
927+
Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); // Check it has the component
928928

929929
GameObject seeItSayItLabelGameObject = null;
930930
foreach (Transform child in testSimpleEmptyButton.transform)
@@ -934,7 +934,7 @@ public IEnumerator TestSimpleEmptyButtonHasSeeItSayItLabelComponentAndReferenced
934934
seeItSayItLabelGameObject = child.gameObject;
935935
}
936936
}
937-
Assert.IsNotNull(seeItSayItLabelGameObject); //Check the referenced GameObject is not null
937+
Assert.IsNotNull(seeItSayItLabelGameObject); // Check the referenced GameObject is not null
938938

939939
Object.Destroy(testSimpleEmptyButton);
940940
// Wait for a frame to give Unity a change to actually destroy the object
@@ -957,7 +957,7 @@ public IEnumerator TestSimpleActionButtonHasSeeItSayItLabelComponentAndReference
957957
yield return null;
958958

959959
SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleActionButton.GetComponents<SeeItSayItLabelEnabler>();
960-
Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); //Check it has the component
960+
Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); // Check it has the component
961961

962962
GameObject seeItSayItLabelGameObject = null;
963963
foreach (Transform child in testSimpleActionButton.transform)
@@ -967,7 +967,7 @@ public IEnumerator TestSimpleActionButtonHasSeeItSayItLabelComponentAndReference
967967
seeItSayItLabelGameObject = child.gameObject;
968968
}
969969
}
970-
Assert.IsNotNull(seeItSayItLabelGameObject); //Check the referenced GameObject is not null
970+
Assert.IsNotNull(seeItSayItLabelGameObject); // Check the referenced GameObject is not null
971971

972972
Object.Destroy(testSimpleActionButton);
973973
// Wait for a frame to give Unity a change to actually destroy the object

0 commit comments

Comments
 (0)