Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Refactor workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Audykowicz committed Aug 25, 2023
1 parent 837ea3a commit 0e6dc56
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 275 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
name: 'CppSDKReleaseAssetDownloader'
description: 'Download specific C++ SDK release asset.'
inputs:
url:
description: 'C++ SDK release URL.'
required: true
tag:
description: 'Release tag of C++ SDK release.'
required: true
asset_name:
description: 'Define name of asset'
asset_suffix:
description: 'The suffix of the C++ SDK asset defining the platform.'
required: true
runs:
using: 'composite'
steps:
- name: Download C++ MacOS
run: |
export INPUT_URL=${{ inputs.url }}
export INPUT_URL="https://github.com/DolbyIO/comms-sdk-cpp/releases/download"
export INPUT_TAG=${{ inputs.tag }}
export INPUT_ASSET_NAME=${{ inputs.asset_name }}
./.github/actions/download_cpp/bash/download_cpp.sh
export INPUT_ASSET_NAME=cppsdk-${{ inputs.tag }}-${{ inputs.asset_suffix }}
./.github/actions/download_cppsdk/bash/download_cppsdk.sh
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
set -e

curl -L ${INPUT_URL}/${INPUT_TAG}/${INPUT_ASSET_NAME} > ${GITHUB_WORKSPACE}/${INPUT_ASSET_NAME} \
&& unzip -q ${GITHUB_WORKSPACE}/${INPUT_ASSET_NAME} -d ${GITHUB_WORKSPACE}/${CPP_SDK_DESTINATION} \
&& unzip -q ${GITHUB_WORKSPACE}/${INPUT_ASSET_NAME} -d ${GITHUB_WORKSPACE}/${PLUGIN_SOURCE_DIR} \
&& rm ${GITHUB_WORKSPACE}/${INPUT_ASSET_NAME}
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
name: 'CppSDKReleaseAssetDownloader'
description: 'Download specific C++ SDK release asset.'
inputs:
url:
description: 'C++ SDK release URL.'
required: true
tag:
description: 'Release tag of C++ SDK release.'
required: true
asset_name:
description: 'Define name of asset'
asset_suffix:
description: 'The suffix of the C++ SDK asset defining the platform.'
required: true
runs:
using: 'composite'
steps:
- name: Download C++ Windows
run: |
$Env:INPUT_URL = "${{ inputs.url }}"
$Env:INPUT_URL = "https://github.com/DolbyIO/comms-sdk-cpp/releases/download"
$Env:INPUT_TAG = "${{ inputs.tag }}"
$Env:INPUT_ASSET_NAME = "${{ inputs.asset_name }}"
./.github/actions/download_cpp/powershell/download_cpp.ps1
$Env:INPUT_ASSET_NAME = "cppsdk-${{ inputs.tag }}-${{ inputs.asset_suffix }}"
./.github/actions/download_cppsdk/powershell/download_cppsdk.ps1
shell: powershell
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Write-Output "Download asset"
curl -Uri ${Env:INPUT_URL}/${Env:INPUT_TAG}/${Env:INPUT_ASSET_NAME} -UseBasicParsing -Out ${Env:GITHUB_WORKSPACE}/${Env:INPUT_ASSET_NAME}
Expand-Archive ${Env:GITHUB_WORKSPACE}/${Env:INPUT_ASSET_NAME} -DestinationPath ${Env:GITHUB_WORKSPACE}/${Env:CPP_SDK_DESTINATION}
Expand-Archive ${Env:GITHUB_WORKSPACE}/${Env:INPUT_ASSET_NAME} -DestinationPath ${Env:GITHUB_WORKSPACE}/${Env:PLUGIN_SOURCE_DIR}
rm ${Env:GITHUB_WORKSPACE}/${Env:INPUT_ASSET_NAME}
209 changes: 132 additions & 77 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,140 +1,195 @@
name: Build Unreal Plugin
name: Build plugin

on:
push:
workflow_dispatch:

permissions:
contents: write
packages: write

env:
CPP_SDK_TAG: "2.6.0-beta.2"
CPP_SDK_DESTINATION: "DolbyIO"
CPP_SDK_URL: "https://github.com/DolbyIO/comms-sdk-cpp/releases/download"
UNREAL_PLUGIN_OUTPUT: "Build/DolbyIO"
PLUGIN_VERSION: "1.2.0-beta.8"
CPP_SDK_VERSION: "2.6.0-beta.2"
PLUGIN_SOURCE_DIR: "DolbyIO"
PLUGIN_BUILD_DIR: "Build/DolbyIO"
GH_TOKEN: ${{ github.token }}
RETENTION: 7

jobs:
build-macos:
build-windows:
strategy:
fail-fast: false
matrix:
version: ["4.27", "5.2"]
runs-on: ["self-hosted", "X64", "macOS"]
runs-on: ["self-hosted", "X64", "Windows"]

env:
BUILD_PLATFORM: 'macos64'
BUILD_PLATFORM: 'windows'

steps:
- name: Code checkout
- name: Check out code
uses: actions/checkout@v3
- name: Download C++ SDK release asset
uses: ./.github/actions/download_cpp/bash

- name: Download C++ SDK
uses: ./.github/actions/download_cppsdk/powershell
with:
url: ${{ env.CPP_SDK_URL }}
tag: ${{ env.CPP_SDK_TAG }}
asset_name: "cppsdk-${{ env.CPP_SDK_TAG }}-${{ env.BUILD_PLATFORM }}-universal.zip"
- name: Remove symlinks from cpp sdk libs
tag: ${{ env.CPP_SDK_VERSION }}
asset_suffix: "${{ env.BUILD_PLATFORM }}64.zip"

- name: Build plugin
env:
LIB_PATH_UNIVERSAL: "${{ github.workspace }}/${{ env.CPP_SDK_DESTINATION }}/sdk-release/lib"
BUILD_ARGS: "BuildPlugin -Rocket -StrictIncludes -Plugin=\"$(pwd)\\DolbyIO\\DolbyIO.uplugin\" -Package=\"$(pwd)\\Build\\DolbyIO\" -TargetPlatforms=Win64 -VS2019"
run: |
echo "Removing symlinks from ${LIB_PATH_UNIVERSAL}"
find ${LIB_PATH_UNIVERSAL} -type l -delete
- name: Run Build
run: |
/Users/Shared/Epic\ Games/UE_${{ matrix.version }}/Engine/Build/BatchFiles/RunUAT.sh BuildPlugin \
-Rocket \
-Plugin=$(pwd)/DolbyIO/DolbyIO.uplugin \
-TargetPlatforms=Mac \
-Package=$(pwd)/${{ env.UNREAL_PLUGIN_OUTPUT }} \
-StrictIncludes \
-Architecture_Mac=x64+arm64
- name: Sign DolbyIO Unreal Plugin
$UAT = "C:\\Program Files\\Epic Games\\UE_${{ matrix.version }}\\Engine\\Build\\BatchFiles\\RunUAT.bat"
& $UAT ${{ env.BUILD_ARGS }}
- name: Sign plugin
env:
DOLBYIO_KEYCHAIN_PASSWORD: ${{ secrets.VOXEET_KEYCHAIN_PASSWORD }}
uses: ./.github/actions/sign/mac
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
uses: ./.github/actions/sign/win
with:
path: ${{ env.UNREAL_PLUGIN_OUTPUT }}
platform: 'macos'
- name: Archive DolbyIO Unreal Plugin
path: ${{ env.PLUGIN_BUILD_DIR }}
platform: ${{ env.BUILD_PLATFORM }}

- name: Zip plugin
working-directory: ${{ env.PLUGIN_BUILD_DIR }}
run: |
Compress-Archive -Path . -DestinationPath DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: DolbyIO_UnrealPlugin_${{ matrix.version }}_${{ env.BUILD_PLATFORM }}
path: ${{ env.UNREAL_PLUGIN_OUTPUT }}
name: DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}
path: "${{ env.PLUGIN_BUILD_DIR }}\\DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip"
retention-days: ${{ env.RETENTION }}

- name: Release plugin 🎉
if: startsWith(github.ref, 'refs/tags/')
working-directory: ${{ env.PLUGIN_BUILD_DIR }}
run: |
${{ github.workspace }}\\.github\\actions\\upload_assets\\upload_release_asset.ps1 -File DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip
build-windows:
build-macos:
strategy:
fail-fast: false
matrix:
version: ["4.27", "5.2"]
runs-on: ["self-hosted", "X64", "Windows"]
runs-on: ["self-hosted", "X64", "macOS"]

env:
BUILD_PLATFORM: 'windows64'
BUILD_PLATFORM: 'macos'

steps:
- name: Code checkout
- name: Check out code
uses: actions/checkout@v3
- name: Download C++ SDK release asset
id: download_cpp
uses: ./.github/actions/download_cpp/powershell

- name: Download C++ SDK
uses: ./.github/actions/download_cppsdk/bash
with:
tag: ${{ env.CPP_SDK_VERSION }}
asset_suffix: "${{ env.BUILD_PLATFORM }}64-universal.zip"

- name: Remove symlinks from C++ SDK libs
run: |
find "${{ github.workspace }}/${{ env.PLUGIN_SOURCE_DIR }}/sdk-release/lib" -type l -delete
- name: Build plugin
env:
BUILD_ARGS: "BuildPlugin -Rocket -StrictIncludes -Plugin=\"$(pwd)/DolbyIO/DolbyIO.uplugin\" -Package=$(pwd)/Build/DolbyIO -TargetPlatforms=Mac -Architecture_Mac=x64+arm64"
run: |
/Users/Shared/Epic\ Games/UE_${{ matrix.version }}/Engine/Build/BatchFiles/RunUAT.sh ${{ env.BUILD_ARGS }}
- name: Sign plugin
env:
DOLBYIO_KEYCHAIN_PASSWORD: ${{ secrets.VOXEET_KEYCHAIN_PASSWORD }}
uses: ./.github/actions/sign/mac
with:
url: ${{ env.CPP_SDK_URL }}
tag: ${{ env.CPP_SDK_TAG }}
asset_name: "cppsdk-${{ env.CPP_SDK_TAG }}-${{ env.BUILD_PLATFORM }}.zip"
- name: Run Build
path: ${{ env.PLUGIN_BUILD_DIR }}
platform: ${{ env.BUILD_PLATFORM }}

- name: Zip plugin
working-directory: Build
run: |
Write-Output "UE_${{ matrix.version }}"
$UERunUAT = "C:\\Program Files\\Epic Games\\UE_${{ matrix.version }}\\Engine\\Build\\BatchFiles\\RunUAT.bat"
& $UERunUAT BuildPlugin -Rocket -Plugin="$(pwd)\\DolbyIO\\DolbyIO.uplugin" -TargetPlatforms=Win64 -Package="$(pwd)\\Build\\DolbyIO" -StrictIncludes -VS2019 -NoTurnKeyVariables
- name: Sign DolbyIO Unreal Plugin
zip -rq DolbyIO/DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip DolbyIO/
- name: Notarize plugin
env:
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
uses: ./.github/actions/sign/win
DOLBYIO_KEYCHAIN_PASSWORD: ${{ secrets.VOXEET_KEYCHAIN_PASSWORD }}
uses: ./.github/actions/notarise/mac
with:
path: ${{ env.UNREAL_PLUGIN_OUTPUT }}
platform: 'windows'
- name: Archive DolbyIO Plugin
catalog_path: ${{ env.PLUGIN_BUILD_DIR }}
file: DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: DolbyIO_UnrealPlugin_${{ matrix.version }}_${{ env.BUILD_PLATFORM }}
path: ${{ env.UNREAL_PLUGIN_OUTPUT }}
name: DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}
path: "${{ env.PLUGIN_BUILD_DIR }}/DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip"
retention-days: ${{ env.RETENTION }}

- name: Release plugin 🎉
if: startsWith(github.ref, 'refs/tags/')
working-directory: ${{ env.PLUGIN_BUILD_DIR }}
run: |
${GITHUB_WORKSPACE}/.github/actions/upload_assets/upload_release_asset.sh DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip
build-linux:
strategy:
fail-fast: false
matrix:
version: ["4.27", "5.2"]
runs-on: ["self-hosted", "X64", "Windows"]

env:
BUILD_PLATFORM: 'linux64'
BUILD_PLATFORM: 'linux'

steps:
- name: Code checkout
- name: Check out code
uses: actions/checkout@v3
- name: Download C++ SDK release asset
id: download_cpp
uses: ./.github/actions/download_cpp/powershell

- name: Download C++ SDK
uses: ./.github/actions/download_cppsdk/powershell
with:
url: ${{ env.CPP_SDK_URL }}
tag: ${{ env.CPP_SDK_TAG }}
asset_name: "cppsdk-${{ env.CPP_SDK_TAG }}-ubuntu-20.04-clang10-libc++10.zip"
- name: Unlink cpp sdk libs
tag: ${{ env.CPP_SDK_VERSION }}
asset_suffix: "ubuntu-20.04-clang10-libc++10.zip"

- name: Resolve C++ SDK lib symlinks
env:
LIB_PATH_UBUNTU: "${{ github.workspace }}\\${{ env.CPP_SDK_DESTINATION }}\\sdk-release-ubuntu-20.04-clang10-libc++10\\lib"
LIB_PATH: "${{ github.workspace }}\\${{ env.PLUGIN_SOURCE_DIR }}\\sdk-release-ubuntu-20.04-clang10-libc++10\\lib"
run: |
Move-Item -Force "${{ env.LIB_PATH_UBUNTU }}\\libavcodec.so.59.33.100" "${{ env.LIB_PATH_UBUNTU }}\\libavcodec.so.59"
Move-Item -Force "${{ env.LIB_PATH_UBUNTU }}\\libavformat.so.59.25.100" "${{ env.LIB_PATH_UBUNTU }}\\libavformat.so.59"
Move-Item -Force "${{ env.LIB_PATH_UBUNTU }}\\libavutil.so.57.27.100" "${{ env.LIB_PATH_UBUNTU }}\\libavutil.so.57"
- name: Run Build
Move-Item -Force "${{ env.LIB_PATH }}\\libavcodec.so.59.33.100" "${{ env.LIB_PATH }}\\libavcodec.so.59"
Move-Item -Force "${{ env.LIB_PATH }}\\libavformat.so.59.25.100" "${{ env.LIB_PATH }}\\libavformat.so.59"
Move-Item -Force "${{ env.LIB_PATH }}\\libavutil.so.57.27.100" "${{ env.LIB_PATH }}\\libavutil.so.57"
- name: Build plugin
env:
BUILD_ARGS: "BuildPlugin -Rocket -StrictIncludes -Plugin=\"$(pwd)\\DolbyIO\\DolbyIO.uplugin\" -Package=\"$(pwd)\\Build\\DolbyIO\" -TargetPlatforms=Linux -NoHostPlatform"
run: |
if(${{ matrix.version }} -eq "4.27"){
$env:LINUX_MULTIARCH_ROOT="C:\\UnrealToolchains\\v19_clang-11.0.1-centos7"
} else {
$env:LINUX_MULTIARCH_ROOT="C:\\UnrealToolchains\\v21_clang-15.0.1-centos7"
}
Write-Output "UE_${{ matrix.version }}"
$UERunUAT = "C:\\Program Files\\Epic Games\\UE_${{ matrix.version }}\\Engine\\Build\\BatchFiles\\RunUAT.bat"
& $UERunUAT BuildPlugin -Rocket -Plugin="$(pwd)\\DolbyIO\\DolbyIO.uplugin" -TargetPlatforms=Linux -Package="$(pwd)\\Build\\DolbyIO" -StrictIncludes -NoHostPlatform -NoTurnKeyVariables
- name: Archive DolbyIO Plugin
$UAT = "C:\\Program Files\\Epic Games\\UE_${{ matrix.version }}\\Engine\\Build\\BatchFiles\\RunUAT.bat"
& $UAT ${{ env.BUILD_ARGS }}
- name: Zip plugin
working-directory: ${{ env.PLUGIN_BUILD_DIR }}
run: |
Compress-Archive -Path . -DestinationPath DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: DolbyIO_UnrealPlugin_${{ matrix.version }}_${{ env.BUILD_PLATFORM }}
path: ${{ env.UNREAL_PLUGIN_OUTPUT }}
name: DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}
path: "${{ env.PLUGIN_BUILD_DIR }}\\DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip"
retention-days: ${{ env.RETENTION }}

- name: Release plugin 🎉
if: startsWith(github.ref, 'refs/tags/')
working-directory: ${{ env.PLUGIN_BUILD_DIR }}
run: |
${{ github.workspace }}\\.github\\actions\\upload_assets\\upload_release_asset.ps1 -File DolbyIO_${{ env.PLUGIN_VERSION }}_UE${{ matrix.version }}_${{ env.BUILD_PLATFORM }}.zip
Loading

0 comments on commit 0e6dc56

Please sign in to comment.