Skip to content

Commit

Permalink
Let's test github builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
BSChad committed Aug 6, 2024
1 parent da998d0 commit 8008fb7
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 3 deletions.
161 changes: 161 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: Actions 😎

on: [push, pull_request]

jobs:
build_windows:
name: Build Windows 🪟
runs-on: ubuntu-latest
steps:
# Checkout (without LFS)
- name: Checkout repository
uses: actions/checkout@v4

# Git LFS
- 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@v3
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
# Cache
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Test
#- name: Run tests
# uses: game-ci/unity-test-runner@v4
# env:
# UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
# UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
# UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
# with:
# githubToken: ${{ secrets.GITHUB_TOKEN }}

# Build Windows
- name: Build project
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneWindows64

# Output
- uses: actions/upload-artifact@v3
with:
name: Windows
path: build

build_osx:
name: Build OSX 🍎
runs-on: ubuntu-latest
steps:
# Checkout (without LFS)
- name: Checkout repository
uses: actions/checkout@v4

# Git LFS
- 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@v3
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
# Cache
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Build OSX
- name: Build project
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneOSX

# Output
- uses: actions/upload-artifact@v3
with:
name: OSX
path: build

build_web:
name: Build WebGL 🕸️
runs-on: ubuntu-latest
steps:
# Checkout (without LFS)
- name: Checkout repository
uses: actions/checkout@v4

# Git LFS
- 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@v3
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
# Cache
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Build WebGL
- name: Build project
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: WebGL

# Output
- uses: actions/upload-artifact@v3
with:
name: Web
path: build
6 changes: 3 additions & 3 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -915,11 +915,11 @@ PlayerSettings:
apiCompatibilityLevel: 6
activeInputHandler: 0
windowsGamepadBackendHint: 0
cloudProjectId:
cloudProjectId: 3e76d0d0-fe0c-4034-bd93-0eedbe3bfd53
framebufferDepthMemorylessMode: 0
qualitySettingsNames: []
projectName:
organizationId:
projectName: Stupid Bullets
organizationId: igobychad
cloudEnabled: 0
legacyClampBlendShapeWeights: 0
hmiLoadingImage: {fileID: 0}
Expand Down

0 comments on commit 8008fb7

Please sign in to comment.