Skip to content

Resolve build issues (#21) #8

Resolve build issues (#21)

Resolve build issues (#21) #8

name: Build & Deploy WebGL
on:
push:
branches:
- master
jobs:
build:
name: Build Project
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v2
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}
- name: Git LFS Pull
run: |
git lfs pull
git add .
git reset --hard
- name: Restore Library cache
uses: actions/cache@v2
with:
path: Library
key: Library-build-WebGL
restore-keys: |
Library-build-
Library-
- name: Unity Build
uses: game-ci/unity-builder@v2
id: unityBuild
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
versioning: Semantic
targetPlatform: WebGL
unityVersion: 2022.1.16f1
buildName: ${{ secrets.PROJECT_NAME }}
buildsPath: build
- name: Print Version Number
run: echo Project Version ${{ steps.unityBuild.outputs.buildVersion }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: build-WebGL
path: build/WebGL
- run: ls -la
deploy:
name: Deploy to itch.io
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/download-artifact@master
with:
name: build-WebGL
path: build/WebGL
- run: ls -la
- name: Butler Deploy
uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: html5
ITCH_GAME: ${{ secrets.PROJECT_NAME }}
ITCH_USER: Exenter
PACKAGE: build/WebGL
VERSION: ${{ steps.unityBuild.outputs.buildVersion }}