Skip to content

Commit

Permalink
License Activation fixes and Github Annotations (#590)
Browse files Browse the repository at this point in the history
* Ensure serial is prioritized

* Add compile listener to create github annotations

* Update node modules

* Don't build ubuntu on PR as secrets are now needed. Update PR template to request an example successful run. Remove 32bit windows build. Build on push to any branch

* Update activation to use blank project

* Ensure exceptions get annotated as well

* More robust console printing

* Update test project

* Build iOS test on macos to verify burst functionality. Add annotation for license activation error. Fix unity version test. Remove minification from android

* Improve license checks

* Mask partially redacted serial in addition to full serial

* Add retry logic to ubuntu builds

* Allow dirty build on retry

* Bump unity version
  • Loading branch information
AndrewKahr authored Nov 12, 2023
1 parent 7afabe7 commit caa0a81
Show file tree
Hide file tree
Showing 45 changed files with 4,702 additions and 3,356 deletions.
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

- ...

#### Successful Workflow Run Link

- ...

#### Checklist

<!-- please check all items and add your own -->
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/build-tests-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Builds - MacOS
on:
workflow_dispatch:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -20,11 +18,12 @@ jobs:
projectPath:
- test-project
unityVersion:
- 2021.3.31f1
- 2022.3.11f1
- 2023.1.17f1
- 2021.3.32f1
- 2022.3.13f1
- 2023.1.19f1
targetPlatform:
- StandaloneOSX # Build a MacOS executable
- iOS # Build an iOS executable

steps:
###########################
Expand Down
60 changes: 51 additions & 9 deletions .github/workflows/build-tests-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ name: Builds - Ubuntu
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
paths-ignore:
- '.github/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -52,9 +47,9 @@ jobs:
projectPath:
- test-project
unityVersion:
- 2021.3.31f1
- 2022.3.11f1
- 2023.1.17f1
- 2021.3.32f1
- 2022.3.13f1
- 2023.1.19f1
targetPlatform:
- StandaloneOSX # Build a macOS standalone (Intel 64-bit) with mono backend.
- StandaloneWindows64 # Build a Windows 64-bit standalone with mono backend.
Expand Down Expand Up @@ -84,14 +79,61 @@ jobs:
###########################
# Build #
###########################
- uses: ./
- name: Build
uses: ./
id: build-1
continue-on-error: true
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
customParameters: -profile SomeProfile -someBoolean -someValue exampleValue
providerStrategy: ${{ matrix.providerStrategy }}

- name: Sleep for Retry
if: ${{ steps.build-1.outcome == 'failure' }}
run: |
sleep 60
- name: Build (Retry 1)
uses: ./
id: build-2
if: ${{ steps.build-1.outcome == 'failure' }}
continue-on-error: true
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
customParameters: -profile SomeProfile -someBoolean -someValue exampleValue
providerStrategy: ${{ matrix.providerStrategy }}
allowDirtyBuild: true

- name: Sleep for Retry
if: ${{ steps.build-2.outcome == 'failure' }}
run: |
sleep 240
- name: Build (Retry 2)
uses: ./
id: build-3
if: ${{ steps.build-2.outcome == 'failure' }}
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
customParameters: -profile SomeProfile -someBoolean -someValue exampleValue
providerStrategy: ${{ matrix.providerStrategy }}
allowDirtyBuild: true

###########################
# Upload #
###########################
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/build-tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Builds - Windows
on:
workflow_dispatch:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -20,13 +18,12 @@ jobs:
projectPath:
- test-project
unityVersion:
- 2021.3.31f1
- 2022.3.11f1
- 2023.1.17f1
- 2021.3.32f1
- 2022.3.13f1
- 2023.1.19f1
targetPlatform:
- Android # Build an Android apk.
- StandaloneWindows64 # Build a Windows 64-bit standalone.
- StandaloneWindows # Build a Windows 32-bit standalone.
- WSAPlayer # Build a UWP App
- tvOS # Build an Apple TV XCode project

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using UnityEngine;
using UnityEditor;

namespace UnityBuilderAction.Reporting
{
[InitializeOnLoad]
static class CompileListener
{
static CompileListener()
{
if (Application.isBatchMode)
{
Application.logMessageReceived += Application_logMessageReceived;
}
}

private static void Application_logMessageReceived(string condition, string stackTrace, LogType type)
{
string prefix = "";
switch (type)
{
case LogType.Error:
prefix = "error";
break;
case LogType.Warning:
prefix = "warning";
break;
case LogType.Exception:
prefix = "error";
break;
}
Console.WriteLine($"{Environment.NewLine}::{prefix} ::{condition}{Environment.NewLine}{stackTrace}");
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit caa0a81

Please sign in to comment.