Skip to content

Commit

Permalink
add 2022 builds (#6)
Browse files Browse the repository at this point in the history
* add 2022 builds

(cherry picked from commit b5c5ea5)

# Conflicts:
#	.github/workflows/ci.yml

* fix naming and comment on what content of secrets are

* fix environment var

* use licenxsing from kuler90 using the UNITY_USERNAME and UNITY_PASSWORD secrets instead of license files

* guessing licensing failure is a false positive

* all the versions again
  • Loading branch information
hardcoded2 authored Apr 6, 2022
1 parent 2f88c7b commit 56341db
Showing 1 changed file with 26 additions and 50 deletions.
76 changes: 26 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@ on: [pull_request,workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
env:
LICENSE: ${{ secrets.LICENSE }} #unity 2019 license
LICENSE2: ${{ secrets.LICENSE2 }}
LICENSE2020: ${{ secrets.LICENSE_2020 }}
LICENSE2021: ${{ secrets.LICENSE_2021 }}
strategy:
matrix:
unity-version-matrix: [ 2019.4.36f1,2020.3.30f1, 2021.2.14f1 ] #,2020.3.30f1, 2021.2.14f1
unity-version-matrix: [ 2019.4.36f1,2020.3.30f1, 2021.2.14f1, 2022.1.0b14 ]

steps:
- name: Checkout Passthrough Example
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: 'true'
#not great, but let's also set up java so we can run sdkmanager. probably a way to avoid this.
#https://github.com/marketplace/actions/setup-unity
#possible modules on linux - android,ios,webgl,linux-il2cpp,mac-mono,windows-mono
- name: Setup Unity
uses: kuler90/setup-unity@v1
with:
unity-version: ${{ matrix.unity-version-matrix }}
unity-modules: android
install-path: /opt/Unity
#need 2fa to not error out I think
- name: Activate Unity
continue-on-error: true
uses: kuler90/activate-unity@v1
with:
unity-username: ${{ secrets.UNITY_USERNAME }}
unity-password: ${{ secrets.UNITY_PASSWORD }}
- name: list all files in current dir
run: |
find .
Expand All @@ -49,6 +52,7 @@ jobs:
echo $NDK_HOME
echo $JAVA_HOME
echo ${{ matrix.unity-version-matrix }}
echo env UNITY_PATH: ${{ env.UNITY_PATH }}
# https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk-java-lang-noclassdeffounderror-javax-xml-bind-a
- name: accept licenses if not already done
Expand All @@ -58,59 +62,31 @@ jobs:
- name: list all files in unity install dir
run: |
find /opt/Unity/
- name: write out license file 2019
if: ${{ contains(matrix.unity-version-matrix,'2019') }}
run: |
echo -n -e "$LICENSE" > license.alf
echo inside a multi-line script: $LICENSE
wc -m license.alf
ls -al *alf
- name: write out license file 2020
if: ${{ contains(matrix.unity-version-matrix,'2020') }}
run: |
echo -n -e "$LICENSE2020" > license.alf
echo inside a multi-line script: $LICENSE2020
wc -m license.alf
ls -al *alf
- name: write out license file 2021
if: ${{ contains(matrix.unity-version-matrix,'2021') }}
run: |
echo -n -e "$LICENSE2021" > license.alf
echo inside a multi-line script: $LICENSE2021
wc -m license.alf
ls -al *alf
- name: alternate secret test
run: |
echo -n -e "$LICENSE2" > license2.alf
echo inside a multi-line script: $LICENSE2
wc -m license2.alf
ls -al *alf
#- run:
# name: accept licenses
# command: |
# echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager --licenses
#https://docs.unity3d.com/Manual/EditorCommandLineArguments.html
- name: manual license activation
run: |
/opt/Unity/${{ matrix.unity-version-matrix }}/Editor/Unity -quit -batchMode -buildTarget Android -logFile -noGraphics -manualLicenseFile license.alf || exit 0
- name: unity android build
run: |
/opt/Unity/${{ matrix.unity-version-matrix }}/Editor/Unity -quit -batchMode -buildTarget Android -logFile -noGraphics -executeMethod TestBuilder.Build || exit 0
# - name: Build Unity
# uses: kuler90/build-unity@v1
# continue-on-error: true
# with:
# build-target: Android
# build-method: TestBuilder.Build

- name: Build Unity
uses: kuler90/build-unity@v1
continue-on-error: true
with:
build-target: Android
build-method: TestBuilder.Build
project-path: ${{ github.workspace }}

#return license failed - "activated manually for this computer and can't be returned" https://github.com/hardcoded2/WavePassthroughOverlayExample/runs/5540616684?check_suite_focus=true#step:9:79
#feels wrong not to do it... just ignore the error code i guess?

- name: return license
continue-on-error: true
#not sure if needed with kuler90 plugin
# - name: return license
# continue-on-error: true
# run: |
# /opt/Unity/${{ matrix.unity-version-matrix }}/Editor/Unity -quit -batchMode -logFile -noGraphics -returnlicense || exit 0
- name: list all files
run: |
/opt/Unity/${{ matrix.unity-version-matrix }}/Editor/Unity -quit -batchMode -logFile -noGraphics -returnlicense || exit 0
find .
- name: list all files in build dir
run: |
find Builds/
Expand Down

0 comments on commit 56341db

Please sign in to comment.