Skip to content

Commit e341134

Browse files
authored
Merge pull request #1709 from ultraleap/rcb/github-actions
Convert to GitHub Actions Workflow
2 parents f137741 + 3de2bb7 commit e341134

283 files changed

Lines changed: 573 additions & 769 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Ignore Copyright Year formatting change.
22
347c826192d4015e8b64287a7d23468955f12158
3+
d49bd9716eb5776b180a09bcd3d07288efc7a025
Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,47 @@
11
---
22
name: Bug report
3-
about: Create a report to help us improve
3+
about: Report a bug with the Unity plugin, packages, examples, or documentation
44
title: ''
5-
labels: ''
5+
labels: 'bug'
66
assignees: ''
77

88
---
99

1010
**Describe the bug**
11-
A clear and concise description of what the bug is.
11+
A clear and concise description of the problem.
1212

1313
**To Reproduce**
1414
Steps to reproduce the behavior:
15-
1. Go to '...'
16-
2. Click on '....'
17-
3. Scroll down to '....'
18-
4. See error
15+
1. Open '...'
16+
2. Import or configure '...'
17+
3. Enter Play Mode / build / run '...'
18+
4. Observe '...'
1919

2020
**Expected behavior**
2121
A clear and concise description of what you expected to happen.
2222

23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
23+
**Actual behavior**
24+
Describe what happened instead, including any error messages.
2525

26-
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
26+
**Project details**
27+
- Unity version:
28+
- Plugin/package version:
29+
- Installation method: OpenUPM / Git URL / local package / .unitypackage / other
30+
- Packages affected:
3031

31-
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
32+
**Environment**
33+
- OS:
34+
- Target platform:
35+
- XR runtime / SDK:
36+
- Device / headset:
37+
- Ultraleap hardware:
38+
- Tracking software version:
39+
40+
**Logs, screenshots, or videos**
41+
If applicable, add screenshots, recordings, stack traces, or relevant excerpts from the Unity Console / Player log.
42+
43+
**Minimal reproduction**
44+
If you can provide a minimal repro project, scene, or script snippet, describe it here or link to it.
3645

3746
**Additional context**
38-
Add any other context about the problem here.
47+
Add any other context that may help investigate the issue.

.github/ISSUE_TEMPLATE/custom.md

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

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature request
33
about: Suggest an idea for this project
44
title: ''
5-
labels: ''
5+
labels: 'enhancement'
66
assignees: ''
77

88
---
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Summary
2+
3+
_Add a Summary here._
4+
5+
## Contributor Tasks
6+
7+
- [ ] Add a CHANGELOG entry for this change.
8+
- [ ] Ensure documentation requirements are met e.g., public API is commented.
9+
- [ ] Consider any licensing/other legal implications for this PR e.g. notices required by any new libraries.
10+
11+
## Test Cycle
12+
13+
_Link to the test cycle here._
14+
15+
## Reviewer Tasks
16+
17+
- [ ] Code reviewed.
18+
- [ ] Non-code assets e.g. Unity assets/scenes reviewed.
19+
- [ ] All tests must be ran and cover all scenarios (If not, add new tests and run them).
20+
- [ ] Documentation has been reviewed.
21+
- [ ] Approve with a comment of any additional tests run or any observations.
Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,20 @@
11
## Pre-Release Tasks
22

3-
[Pre-release](https://ultrahaptics.atlassian.net/wiki/spaces/SV/pages/3665625233/Unity+Plugin+Development+Release+Process#Pre-release-Steps)
4-
- [ ] Update JIRA release version number. _See the [releases page](https://ultrahaptics.atlassian.net/projects/UNITY?selectedItem=com.atlassian.jira.jira-projects-plugin:release-page)._
3+
### Pre-release
54
- [ ] Update package.json versions and dependencies
65
- [ ] Update client libraries (.dll, .so, .dylib)
76
- [ ] Update changelog date, release version & client library versions
87
- [ ] Update Readme if required
98
- [ ] Apply CI formatting patch
109
- [ ] Ensure documentation requirements are met e.g., public API is commented.
1110
- [ ] If this is a major release, action any `Obsolete` items and other breaking considerations.
12-
1311
- [ ] Run the required tests for the release
14-
- [ ] Complete the request to release on Cognidox
1512

16-
[After Approval](https://ultrahaptics.atlassian.net/wiki/spaces/SV/pages/3665625233/Unity+Plugin+Development+Release+Process#Release-Steps)
13+
### After Approval
1714
- [ ] Tag the branch (e.g. com.ultraleap.tracking/5.9.0 and com.ultraleap.tracking.preview/5.9.0)
1815
- [ ] Merge to main
19-
- [ ] Crate Github Release with CI artefact for .unitypackage
16+
- [ ] Create a GitHub Release with the CI artifact for the .unitypackage
2017
- [ ] Resolve any public GitHub issues
21-
- [ ] Release version on JIRA and make a new Unity Plugin NEXT version
2218
- [ ] Merge main to develop (also add [NEXT] - unreleased to changelog)
2319
- [ ] Announce release on various platforms
2420
- [ ] Publish any accompanying docs
25-
26-
## Pull Request Templates
27-
28-
Switch template by going to preview and clicking the link - note it not work if you've made any changes to the description.
29-
30-
- [default.md](?expand=1) - for contributions to stable packages.
31-
- [release.md](?expand=1&template=release.md) - for release merge requests.
32-
33-
**You are currently using: release.md**
34-
35-
Note: these links work by overwriting query parameters of the current url. If the current url contains any you may want to amend the url with `&template=name.md` instead of using the link. See [query parameter docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/using-query-parameters-to-create-a-pull-request) for more information.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Check formatting
2+
description: Run formatting checks and write a diff artifact when changes are required
3+
4+
outputs:
5+
has_diff:
6+
description: Whether the formatting check produced a diff artifact
7+
value: ${{ steps.result.outputs.has_diff }}
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- uses: actions/setup-dotnet@v5
13+
with:
14+
dotnet-version: 8.0.x
15+
16+
- name: Install dotnet-format
17+
shell: bash
18+
run: |
19+
set -euo pipefail
20+
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
21+
dotnet tool install --global dotnet-format || dotnet tool update --global dotnet-format
22+
23+
- name: Run dotnet-format
24+
shell: bash
25+
run: |
26+
set -euo pipefail
27+
dotnet-format -f --exclude .git Scripts Markdown
28+
29+
- name: Apply Copyright Year and Namespace Fixes
30+
shell: bash
31+
run: |
32+
set -euo pipefail
33+
export CURRENT_YEAR="$(date +%Y)"
34+
find Packages -type f -name '*.cs' -print0 | xargs -0 perl -0pi -e '
35+
s/^ \* Copyright \(C\) Ultraleap.*$/ * Copyright (C) Ultraleap, Inc. 2011-$ENV{CURRENT_YEAR}. */mg;
36+
if (/using Leap\.Unity|namespace Leap\.Unity/) {
37+
s/ Utils\./ Leap.Unity.Utils./g;
38+
}
39+
'
40+
41+
- name: Generate Formatting Diff
42+
id: result
43+
shell: bash
44+
run: |
45+
set -euo pipefail
46+
diff_path="$ARTIFACTS_PATH/dotnet_format_results.diff"
47+
48+
mapfile -t linter_errors < <(git --no-pager diff --name-only -- '*.cs')
49+
if ((${#linter_errors[@]})); then
50+
printf 'Detected %s formatting issues:\n' "${#linter_errors[@]}"
51+
printf '%s\n' "${linter_errors[@]}"
52+
mkdir -p "$ARTIFACTS_PATH"
53+
git diff > "$diff_path"
54+
echo "has_diff=true" >> "$GITHUB_OUTPUT"
55+
exit 1
56+
else
57+
echo "No formatting issues detected."
58+
echo "has_diff=false" >> "$GITHUB_OUTPUT"
59+
fi
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Export Unity Package
2+
description: Generate Version.txt and export a Unity package artifact
3+
4+
inputs:
5+
package_root_path:
6+
description: Path to the package root
7+
required: true
8+
package_import_path:
9+
description: Import path inside the Unity package
10+
required: true
11+
package_file_name:
12+
description: File name for the generated .unitypackage
13+
required: true
14+
artifact_root_path:
15+
description: Root path that will contain the generated unitypackage artifacts
16+
required: true
17+
package_output_path:
18+
description: Existing output path to reuse for the generated .unitypackage directory
19+
required: false
20+
21+
outputs:
22+
package_version:
23+
description: Exported package version
24+
value: ${{ steps.export.outputs.package_version }}
25+
package_output_path:
26+
description: Output path containing the generated .unitypackage
27+
value: ${{ steps.export.outputs.package_output_path }}
28+
29+
runs:
30+
using: composite
31+
steps:
32+
- name: Export Unity Package
33+
id: export
34+
shell: pwsh
35+
run: |
36+
. "Scripts/ExportUnityPackage.ps1"
37+
38+
Export-VersionTxt "${{ inputs.package_root_path }}"
39+
40+
$packageVersion = Get-Content (Join-Path "${{ inputs.package_root_path }}" "Version.txt")
41+
$packageOutputPath = "${{ inputs.package_output_path }}"
42+
if ([string]::IsNullOrWhiteSpace($packageOutputPath)) {
43+
$packageOutputPath = Join-Path "${{ inputs.artifact_root_path }}" "Ultraleap.UnityPlugin-$packageVersion"
44+
}
45+
New-Item -Path $packageOutputPath -ItemType Directory -Force | Out-Null
46+
47+
$unitypackageOutputPath = Join-Path $packageOutputPath "${{ inputs.package_file_name }}"
48+
49+
$exportErrors = $null
50+
Export-UnityPackage `
51+
-PackageRootPath "${{ inputs.package_root_path }}" `
52+
-PackageImportPath "${{ inputs.package_import_path }}" `
53+
-PackageOutputPath $unitypackageOutputPath `
54+
-ErrorVariable exportErrors
55+
56+
if ($exportErrors) {
57+
throw "Failed to generate $unitypackageOutputPath"
58+
}
59+
60+
"package_version=$packageVersion" >> $env:GITHUB_OUTPUT
61+
"package_output_path=$packageOutputPath" >> $env:GITHUB_OUTPUT

.github/pull_request_template.md

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

0 commit comments

Comments
 (0)