Skip to content

Run build & manual conversion #33

Run build & manual conversion

Run build & manual conversion #33

name: Run build & manual conversion
on:
workflow_dispatch:
inputs:
baseUrl:
required: true
default: "https://peer.decentraland.org/content"
type: string
description: "Content server baseUrl"
pointer:
required: true
default: "urn:decentraland:off-chain:base-avatars:brown_pants"
type: string
description: "Pointer or entity to convert"
build:
type: boolean
default: false
description: "Build image before converting"
jobs:
main:
strategy:
matrix:
include:
- unity_docker_image: unityci/editor:2021.3.22f1-webgl-1
service_name: asset-bundle-converter
platform_target: webgl
- unity_docker_image: unityci/editor:2021.3.22f1-windows-mono-1
service_name: asset-bundle-converter-windows
platform_target: windows
- unity_docker_image: unityci/editor:2021.3.22f1-mac-mono-1
service_name: asset-bundle-converter-mac
platform_target: mac
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
lfs: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image
id: docker_build
if: ${{ inputs.build }}
uses: docker/build-push-action@v3
with:
context: .
push: false
tags: quay.io/decentraland/${{ matrix.service_name }}:next,quay.io/decentraland/${{ matrix.service_name }}:${{ github.sha }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
COMMIT_HASH=${{ github.sha }}
UNITY_DOCKER_IMAGE=${{ matrix.unity_docker_image }}
PLATFORM_TARGET=${{ matrix.platform_target }}
- name: Create $(pwd)/tmp/Unity/Unity_lic.ulf
run: mkdir -p $(pwd)/tmp/Unity && echo "$UNITY_2021_ULF" > $(pwd)/tmp/Unity/Unity_lic.ulf
env:
UNITY_2021_ULF: ${{ secrets.UNITY_2021_ULF }}
- name: Run conversion
run: |
mkdir -p $(pwd)/artifact &&
docker run \
-v $(pwd)/artifact:/artifact \
-v $(pwd)/tmp/Unity:/root/.local/share/unity3d/Unity \
quay.io/decentraland/${{ matrix.service_name }}${{ inputs.build && format('@{0}', steps.docker_build.outputs.digest) || ':next' }} \
node --trace-warnings --abort-on-uncaught-exception --unhandled-rejections=strict dist/test-conversion.js \
--baseUrl ${{ inputs.baseUrl }} \
--pointer ${{ inputs.pointer }} \
--outDir /artifact \
--logFile /artifact/log.txt
- uses: actions/upload-artifact@v3
with:
name: ${{ inputs.pointer }}
path: |
artifact/**/*