Skip to content

cd-dev-unity

cd-dev-unity #36

Workflow file for this run

name: cd-dev-unity
on:
workflow_dispatch:
inputs:
version:
description: "version of rc"
required: true
jobs:
build-android:
name: πŸš€ Build Face Unity Sample Android Dapp πŸš€
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true
# Cache
- uses: actions/cache@v2
with:
path: Library
key: Library-Android-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-Android-
# Build
- name: Build Android project
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: Android
versioning: Custom
version: ${{ github.event.inputs.version }}
- uses: actions/setup-node@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- name: create-json
id: create-json
uses: jsdaniell/create-json@1.1.2
with:
name: "service_account.json"
json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY_DEV }}
- name: Distribute Android
run: sudo fastlane android
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
# Output
- uses: actions/upload-artifact@v2
with:
name: Build-Android
path: build
build-iOS:
name: πŸš€ Build Face Unity Sample iOS Dapp πŸš€
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true
# Cache
- uses: actions/cache@v2
with:
path: Library
key: Library-IOS-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-IOS-
- name: Build iOS project
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: iOS
versioning: Custom
version: ${{ github.event.inputs.version }}
# Output
- uses: actions/upload-artifact@v2
with:
name: Build-IOS
path: build
distribution-ios:
needs: build-iOS
runs-on: macos-latest
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true
- uses: actions/download-artifact@master
with:
name: Build-IOS
path: build
- uses: actions/cache@v2
with:
path: build/iOS/iOS/Carthage
key: Carthage-${{ hashFiles('**/Cartfile.resolved') }}
restore-keys: |
Carthage-
- uses: actions/setup-node@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
- name: create-json
id: create-json
uses: jsdaniell/create-json@1.1.2
with:
name: "service_account.json"
json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY_DEV }}
- name: Distribute ios
run: /Users/runner/hostedtoolcache/Ruby/3.0.5/x64/bin/bundle exec fastlane ios
env:
HAECHI_UNITY_PAT: ${{ secrets.HAECHI_UNITY_PAT }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
build-webgl:
name: πŸš€ Build Face Unity Sample WebGL Dapp πŸš€
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true
# Cache
- uses: actions/cache@v2
with:
path: Library
key: Library-WebGL-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-WebGL-
# Build
- name: Build WebGL project
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: WebGL
versioning: Custom
version: ${{ github.event.inputs.version }}
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v0
with:
service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY_DEV }}
project_id: prj-d-face
export_default_credentials: true
- name: Deploy
run: |-
gsutil -m rsync -r build/WebGL/WebGL gs://sample-unity-dapp.dev.facewallet.xyz
- uses: actions/upload-artifact@v2
with:
name: Build-WebGL
path: build