Skip to content

Bump version to 2.0.7 #434

Bump version to 2.0.7

Bump version to 2.0.7 #434

Workflow file for this run

name: Build (multiple jobs)
on:
push:
jobs:
params:
name: Params
runs-on: ubuntu-latest
outputs:
jobs: ${{ steps.params.outputs.jobs }}
steps:
- name: Parameters
id: params
shell: python
run: |
import os
is_pro_master = os.environ['GITHUB_REF_NAME'] == 'pro-master'
is_pro = os.environ['GITHUB_REPOSITORY'] == "OndrejNepozitek/Edgar-UnityPRO"
unity_versions = ['2019.4.36f1', '2020.3.30f1', '2021.3.4f1', '2022.1.3f1']
render_pipelines = ['builtin', 'URP']
structure_branch = 'pro' if is_pro else 'master'
jobs = [
{
'unityVersion': unity_version,
'renderPipeline': render_pipeline,
'structureBranch': structure_branch if render_pipeline == 'builtin' else 'urp'
}
for unity_version in unity_versions
for render_pipeline in render_pipelines
if render_pipeline == 'builtin' or (not unity_version.startswith('2018') and is_pro_master) or (unity_version.startswith('2019') and is_pro)
]
print(f'::set-output name=jobs::{jobs!s}')
print("Jobs:")
print(jobs)
build:
name: Test & build
needs: [params]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.params.outputs.jobs) }}
steps:
# Checkout Unity project structure
- name: Checkout Unity project structure
uses: actions/checkout@v2
with:
repository: OndrejNepozitek/Edgar-UnityProjectStructure
ref: ${{ matrix.structureBranch }}
# Checkout this repository
- name: Checkout this repository
uses: actions/checkout@v2
with:
path: Assets/Edgar
# Test
- name: Run tests
uses: game-ci/unity-test-runner@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_NEW }}
with:
unityVersion: ${{ matrix.unityVersion }}
# Build
- name: Run build
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_NEW }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: StandaloneWindows
versioning: None
package:
name: Package
runs-on: ubuntu-latest
steps:
# Checkout Unity project structure
- name: Checkout Unity project structure
uses: actions/checkout@v2
with:
repository: OndrejNepozitek/ProceduralLevelGenerator-UnityProjectStructure
# Checkout this repository
- name: Checkout this repository
uses: actions/checkout@v2
with:
path: Assets/Edgar
# Prepare unitypackage file list
- name: Prepare unitypackage file list
run: |
echo "Assets/Edgar.meta" > unitypackageFiles
find ./Assets/Edgar/ -name \*.meta ! -path "./Assets/Edgar/Tests*" ! -path "./Assets/Edgar/Examples/Grid2D/Platformer3*" ! -path "./Assets/Edgar/Examples/Grid2D/Resources/Docs*" ! -path "./Assets/Edgar/*.md.meta" ! -path "./Assets/Edgar/Edgar-Unity.sln.DotSettings.meta" >> unitypackageFiles
# Package files
- name: Package files
uses: pCYSl5EDgo/create-unitypackage@master
with:
package-path: 'Edgar.unitypackage'
include-files: unitypackageFiles
# Upload unitypackage
- name: Upload unitypackage
uses: actions/upload-artifact@v3
with:
path: Edgar.unitypackage
name: Edgar_CI_build.unitypackage
release:
name: Release
runs-on: ubuntu-latest
needs: [package, build]
if: startsWith(github.ref, 'refs/tags/')
steps:
# Download package
- name: Download package
uses: actions/download-artifact@v3
with:
name: Edgar_CI_build.unitypackage
# Prepare release package name
- name: Prepare release package name
shell: python
run: |
import os
ref = os.environ["GITHUB_REF_NAME"]
ref = ref.replace('v', '', 1)
ref = ref.replace('.', '_')
ref = ref.replace('-', '_')
package_name = f"Edgar_{ref}.unitypackage"
print(f"::set-output name=PACKAGE_NAME::{package_name}")
import shutil
shutil.copyfile('Edgar.unitypackage', package_name)
env:
GITHUB_REF_NAME: ${{ github.ref_name }}
id: get_package_name
# Upload unitypackage
- name: Upload unitypackage
uses: actions/upload-artifact@v3
with:
path: ${{ steps.get_package_name.outputs.PACKAGE_NAME }}
name: ${{ steps.get_package_name.outputs.PACKAGE_NAME }}
# Release
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.get_package_name.outputs.PACKAGE_NAME }}
draft: true
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
api-docs:
name: Rebuild API docs
runs-on: ubuntu-latest
if: github.ref_name == 'pro-dev'
steps:
# Trigger api docs build
- name: Trigger api docs build
run: |
curl -XPOST -u "${{secrets.GH_PAT_USERNAME}}:${{secrets.GH_PAT}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/OndrejNepozitek/ProceduralLevelGenerator-UnityApiDocs/dispatches --data '{"event_type": "build_application"}'