Skip to content

Commit

Permalink
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: MSBuild
on:
push:
branches:
- main
- actions
#pull_request:
# branches: [ main ]
workflow_dispatch:

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./CodeLegacy/Flowframes.sln

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

# Python version to embed.
PYTHON_MINOR: 8
PYTHON_PATCH: 19
# Python version to use for building.
PYTHON_PATCH_SYS: 10

permissions:
contents: read

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Cache Commit SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $env:GITHUB_OUTPUT
#- name: Check Commit SHA
# run: echo ${{steps.vars.outputs.sha_short}}

- name: Add Python to PATH
uses: actions/setup-python@v5
with:
python-version: 3.${{env.PYTHON_MINOR}}.${{env.PYTHON_PATCH_SYS}}

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Add NuGet to PATH
uses: nuget/setup-nuget@v2

- name: Embed Python
working-directory: .\pkgs
run: |
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/jtmoon79/PythonEmbed4Win/main/PythonEmbed4Win.ps1" -OutFile "PythonEmbed4Win.ps1"
(Get-Content .\PythonEmbed4Win.ps1) -replace 'www\.python.org\/ftp\/python', 'raw.githubusercontent.com/adang1345/PythonWindows/master' | Set-Content .\PythonEmbed4Win.ps1
.\PythonEmbed4Win.ps1 -Version 3.${{env.PYTHON_MINOR}}.${{env.PYTHON_PATCH}} -Path py-amp -Arch amd64
- name: Embed PyTorch
run: |
cd .\pkgs\py-amp
.\python.exe -m pip install numpy==1.19.3
.\python.exe -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
.\python.exe -m pip install opencv-python sk-video imageio
- name: NuGet Restore
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Build Flowframes
working-directory: ${{env.GITHUB_WORKSPACE}}
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform="x64" ${{env.SOLUTION_FILE_PATH}}

# Syntax: PackageBuild.bat <version> <build_slim> <build_full> <build_installer>
- name: Build Package
working-directory: .\Build
run: cmd /C CALL PackageBuild.bat ${{steps.vars.outputs.sha_short}} N Y N

- name: Upload Package
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: FF-${{steps.vars.outputs.sha_short}}-Full
path: ./Build/FF-${{steps.vars.outputs.sha_short}}-Full-RTX3000.7z

0 comments on commit 4e5ceee

Please sign in to comment.