@@ -4,49 +4,48 @@ name: Build
44
55on : [push]
66
7- # Secret Environments
8- # - BASE64_ULF
9- # - AWS_ACCESS_KEY_ID
10- # - AWS_SECRET_ACCESS_KEY
11- # - UNITY_PACKAGES_BUCKET
12- # - UNITY_PACKAGES_CACHE_PREFIX
13- # - FIREBASE_PROJECT_ID
14- # - FIREBASE_TOKEN
157jobs :
168 build :
179 runs-on : ubuntu-latest
1810 container :
19- image : gableroux/unity3d:2019.3.9f1 -webgl
11+ image : unityci/editor:ubuntu-6000.0.37f1 -webgl-3.1
2012 env :
21- UNITY_CMD : /opt/Unity/Editor/Unity
13+ UNITY_CMD : /opt/unity/Editor/Unity
14+ ULF_FILE : Unity_v6000.x.ulf
2215 BASE64_ULF : ${{ secrets.BASE64_ULF }}
2316 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
2417 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2518 UNITY_PACKAGES_BUCKET : ${{ secrets.UNITY_PACKAGES_BUCKET }}
2619 UNITY_PACKAGES_CACHE_PREFIX : ${{ secrets.UNITY_PACKAGES_CACHE_PREFIX }}
20+ UNITY_EMAIL : ${{ secrets.UNITY_EMAIL }}
21+ UNITY_PASSWORD : ${{ secrets.UNITY_PASSWORD }}
2722 FIREBASE_PROJECT_ID : ${{ secrets.FIREBASE_PROJECT_ID }}
2823 FIREBASE_TOKEN : ${{ secrets.FIREBASE_TOKEN }}
2924
3025 steps :
3126 # Checkout
32- - uses : actions/checkout@v2
27+ - uses : actions/checkout@v4
3328
3429 # Add PATH
35- - run : echo "::add-path:: ${GITHUB_WORKSPACE}/bin"
30+ - run : echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
3631
3732 # Install middlewares/tools
3833 - name : Install basic packages
3934 run : |
40- apt-get update
41- apt-get install -y curl gettext
42- - name : Install Node.js
35+ apt update -qq
36+ apt install -y build-essential tree vim less curl unzip dnsutils net-tools procps
37+ apt install -y --no-install-recommends apt-utils
38+ apt install -y gettext
39+ - name : Install Node.js(System)
40+ run : apt install -y nodejs npm
41+ - name : Install Node.js 22.14.0
4342 run : |
4443 npm install -g n
45- n 12.16.3
44+ n 22.14.0
4645 - name : Install Ruby
47- run : apt-get install -y ruby
46+ run : apt install -y ruby
4847 - name : Install ImageMagick
49- run : apt-get install -y imagemagick
48+ run : apt install -y imagemagick
5049 - name : Install openupm
5150 run : npm install -g openupm-cli
5251 - name : Install aws-cli
@@ -59,27 +58,24 @@ jobs:
5958 run : npm install -g firebase-tools
6059
6160 # Download Unity packages
62- - name : Cache Unity packages
63- uses : actions/cache@v1
64- with :
65- path : /root/unity-assets
66- key : minecraft-clone-unity-packages-${{ secrets.UNITY_PACKAGES_CACHE_PREFIX }}-${{ hashFiles('Packages/asset.json') }}
67- - name : Download unity packages
68- run : download-unity-packages --bucket=${UNITY_PACKAGES_BUCKET} --output=/root/unity-assets
61+ # - name: Cache Unity packages
62+ # uses: actions/cache@v4
63+ # with:
64+ # path: /root/unity-assets
65+ # key: minecraft-clone-unity-packages-${{ secrets.UNITY_PACKAGES_CACHE_PREFIX }}-${{ hashFiles('Packages/asset.json') }}
66+ # - name: Download unity packages
67+ # run: download-unity-packages --bucket=${UNITY_PACKAGES_BUCKET} --output=/root/unity-assets
6968
7069 # Build
7170 - name : Expand ULF file
72- run : echo ${BASE64_ULF} | base64 -d > Unity_v2019.x.ulf
71+ run : echo -n " ${BASE64_ULF}" | base64 -d > ${ULF_FILE}
7372 - name : Activation
74- run : unity -manualLicenseFile Unity_v2019.x.ulf || true
75- - name : Import Assets
76- run : unity -executeMethod ImportAssets.Import /basePath /root/unity-assets
77- - name : Apply patches
78- run : apply_patch
79- - name : Generate Textures
80- run : generate_texture
73+ run : unity -manualLicenseFile ${ULF_FILE} -username ${UNITY_EMAIL} -password ${UNITY_PASSWORD}
74+
75+ # - name: Import Assets
76+ # run: unity -executeMethod ImportAssets.Import /basePath /root/unity-assets || true
8177 - name : Build
82- run : unity -executeMethod Builder.Build /platform webgl
78+ run : unity -executeMethod Builder.BuildWebGL
8379
8480 # Deploy to Firebase
8581 - name : Make .firebaserc
8884 run : firebase deploy --token=${FIREBASE_TOKEN}
8985
9086 # Upload Artifacts
91- - uses : actions/upload-artifact@v2
87+ - uses : actions/upload-artifact@v4
9288 with :
9389 name : minecraft-clone.webgl
94- path : Build/minecraft-clone.webgl
90+ path : Build/webgl/ minecraft-clone.webgl
0 commit comments