Skip to content

free disk space in ci #12

free disk space in ci

free disk space in ci #12

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build For ${{ matrix.build.target }}
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build:
- { target: Android, method: CodeBlaze.Editor.Build.Builder.BuildAndroidRelease }
- { target: StandaloneWindows64, method: CodeBlaze.Editor.Build.Builder.BuildWindowsRelease }
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3
with:
path: Library
key:
Library-${{ matrix.build.target }}-${{ hashFiles('.') }}
restore-keys: |
Library-${{ matrix.build.target }}-
Library-
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.build.target }}
buildMethod: ${{ matrix.build.method }}
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.build.target }}
path: |
Build
!**/*DoNotShip*/**
!**/*ButDontShipItWithYourGame*/**
package:
name: Unity Package
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3
with:
path: Library
key:
Library-Package-${{ hashFiles('.') }}
restore-keys: |
Library-Package-
Library-
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneLinux64
buildMethod: CodeBlaze.Editor.Build.Builder.Package
- uses: actions/upload-artifact@v3
with:
name: Package
path: vloxyengine.unitypackage
release:
name: Release
runs-on: ubuntu-latest
needs: [build, package]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- uses: actions/download-artifact@v3
with:
path: artifacts
- name: Zip artifacts
run: |
zip -r android-${{ github.ref_name }}.zip artifacts/Build-Android/
zip -r windows64-${{ github.ref_name }}.zip artifacts/Build-StandaloneWindows64/
- name: Move package
run: mv artifacts/Package/vloxyengine.unitypackage vloxyengine-${{ github.ref_name }}.unitypackage
- name: UPM
run: |
git branch -d upm &> /dev/null || echo upm branch not found
git subtree split -P "$PKG_ROOT" -b upm
git checkout upm
if [[ -d "Samples" ]]; then
git mv Samples Samples~
rm -f Samples.meta
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
git commit -am "fix: Samples => Samples~"
fi
git push -f -u origin upm
env:
PKG_ROOT: Packages/io.codeblaze.vloxyengine
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
vloxyengine-${{ github.ref_name }}.unitypackage
android-${{ github.ref_name }}.zip
windows64-${{ github.ref_name }}.zip