Skip to content

Commit

Permalink
Merge pull request sall#13 from johncbaur/master
Browse files Browse the repository at this point in the history
Updating branch from master.
  • Loading branch information
johncbaur authored Jul 4, 2020
2 parents 1cec4c2 + a6bd428 commit 377fa67
Show file tree
Hide file tree
Showing 12 changed files with 462 additions and 53 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/compile_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Compile Test

on:
push:
branches-ignore:
- master
tags-ignore:
- '**'
paths-ignore:
- '**/.gitignore'
- '**/README.md'
- .github/**
- .tgitconfig

pull_request:
branches:
- master
paths-ignore:
- '**/.gitignore'
- '**/README.md'
- .github/**
- .tgitconfig


jobs:

compile_x86:

runs-on: windows-2019

steps:

- uses: actions/checkout@v2

- uses: nuget/setup-nuget@v1

- uses: microsoft/[email protected]

- name: NuGet Restore
run: nuget restore Vixen.sln

- name: Build x86
run: msbuild Vixen.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=x86

- run: dir
shell: cmd


compile_x64:

runs-on: windows-2019

steps:

- uses: actions/checkout@v2

- uses: nuget/setup-nuget@v1

- uses: microsoft/[email protected]

- name: NuGet Restore
run: nuget restore Vixen.sln

- name: Build x64
run: msbuild Vixen.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=x64

- run: dir
shell: cmd
285 changes: 285 additions & 0 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
name: Release Build

on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+u[0-9]+'
paths-ignore:
- '**/.gitignore'
- '**/README.md'
- .github/**
- .tgitconfig

jobs:

setup:

if: github.repository == 'VixenLights/Vixen'

runs-on: windows-2019

outputs:
build_number: ${{ env.BUILD_NUMBER }}
notes_build_type: ${{ env.VIX_NOTES_BUILD_TYPE }}
notes_fix_version: ${{ env.VIX_NOTES_FIX_VERSION }}
pre_release: ${{ env.VIX_PRE_RELEASE }}
release_notes_markdown: ${{ env.VIX_RELEASE_NOTES_MARKDOWN }}
release_tag: ${{ env.VIX_RELEASE_TAG }}
version: ${{ env.VIX_VERSION }}

steps:

- uses: actions/checkout@v2

- name: Set BUILD_NUMBER
uses: einaregilsson/build-number@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set variables
shell: bash
run: |
if echo "${GITHUB_REF}" | grep -q "^refs/tags/" ;then
VIX_RELEASE_TAG=$(echo "${GITHUB_REF}" | sed -e 's!^refs/tags/!!')
set -- $(echo "${VIX_RELEASE_TAG}" | tr '.u' ' ')
echo "::set-env name=VIX_NOTES_FIX_VERSION::DevBuild"
echo "::set-env name=VIX_NOTES_BUILD_TYPE::${1}.${2}u${3:-0}"
echo "::set-env name=VIX_PRE_RELEASE::false"
echo "::set-env name=VIX_RELEASE_TAG::${VIX_RELEASE_TAG}"
echo "::set-env name=VIX_VERSION::${1}.${2}.${BUILD_NUMBER}.${3:-0}"
else
echo "::set-env name=VIX_NOTES_FIX_VERSION::DevBuild"
echo "::set-env name=VIX_NOTES_BUILD_TYPE::Development"
echo "::set-env name=VIX_PRE_RELEASE::true"
echo "::set-env name=VIX_RELEASE_TAG::Testbuild-${BUILD_NUMBER}"
echo "::set-env name=VIX_VERSION::0.0.${BUILD_NUMBER}.0"
fi

- name: Update release notes
run: ./Build/CreateReleaseNotes.ps1 -jiraUrl "http://bugs.vixenlights.com" -project "Vixen 3" -fixVersion "${env:VIX_NOTES_FIX_VERSION}" -buildType "${env:VIX_NOTES_BUILD_TYPE}"

- name: Upload Release Notes artifact
uses: actions/upload-artifact@v1
with:
name: _releaseNotes
path: "Release Notes.txt"


build_x86:

needs:
- setup

outputs:
setup_32: ${{ env.SETUP_32 }}

runs-on: windows-2019

steps:

- uses: actions/checkout@v2

- name: Download Release Notes artifact
uses: actions/download-artifact@v1
with:
name: _releaseNotes

- name: Move Release Notes into place
run: Copy-Item "_releaseNotes\Release Notes.txt" -Destination "Release Notes.txt" -Force

- uses: nuget/setup-nuget@v1

- uses: microsoft/[email protected]

- name: Setup custom NSIS
id: setup-nsis
uses: VixenLights/[email protected]
with:
just-include: true
include-more-plugins: true

- name: Update versions
run: |
./Build/dotnet-setversion/setversion ${{ needs.setup.outputs.version }} Vixen.System\Vixen.csproj
./Build/dotnet-setversion/setversion ${{ needs.setup.outputs.version }} Application\VixenApplication\VixenApplication.csproj
- name: NuGet Restore
run: nuget restore Vixen.sln

- name: Build x86
run: msbuild Vixen.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=x86

- name: Build x86 installer
run: ${{ steps.setup-nsis.outputs.nsis-path }} /DBUILDARCH=32 Installer\Installer.nsi
shell: cmd

- run: dir
shell: cmd

- name: Set installer name in environment
shell: bash
run: |
echo "::set-env name=SETUP_32::$(echo Vixen*Setup-32bit.exe)"
- name: Upload _setup32 artifact
uses: actions/upload-artifact@v1
with:
name: _setup32
path: ${{ env.SETUP_32 }}


build_x64:

needs:
- setup

outputs:
setup_64: ${{ env.SETUP_64 }}

runs-on: windows-2019

steps:

- uses: actions/checkout@v2

- name: Download Release Notes artifact
uses: actions/download-artifact@v1
with:
name: _releaseNotes

- name: Move Release Notes into place
run: Copy-Item "_releaseNotes\Release Notes.txt" -Destination "Release Notes.txt" -Force

- uses: nuget/setup-nuget@v1

- uses: microsoft/[email protected]

- name: Setup custom NSIS
id: setup-nsis
uses: VixenLights/[email protected]
with:
just-include: true
include-more-plugins: true

- name: Update versions
run: |
./Build/dotnet-setversion/setversion ${{ needs.setup.outputs.version }} Vixen.System\Vixen.csproj
./Build/dotnet-setversion/setversion ${{ needs.setup.outputs.version }} Application\VixenApplication\VixenApplication.csproj
- name: NuGet Restore
run: nuget restore Vixen.sln

- name: Build x64
run: msbuild Vixen.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=x64

- name: Build x64 installer
run: ${{ steps.setup-nsis.outputs.nsis-path }} /DBUILDARCH=64 Installer\Installer.nsi
shell: cmd

- run: dir
shell: cmd

- name: Set installer name in environment
shell: bash
run: |
echo "::set-env name=SETUP_64::$(echo Vixen*Setup-64bit.exe)"
- name: Upload _setup64 artifact
uses: actions/upload-artifact@v1
with:
name: _setup64
path: ${{ env.SETUP_64 }}


create_release:

needs:
- setup
- build_x86
- build_x64

runs-on: windows-2019

steps:

- name: Download _setup32 artifact
uses: actions/download-artifact@v1
with:
name: _setup32

- name: Download _setup64 artifact
uses: actions/download-artifact@v1
with:
name: _setup64

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.setup.outputs.release_tag }}
release_name: ${{ needs.setup.outputs.release_tag }}
body: |
${{ needs.setup.outputs.release_notes_markdown }}
draft: false
prerelease: ${{ needs.setup.outputs.pre_release }}

- name: Upload x86 release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: _setup32/${{ needs.build_x86.outputs.setup_32 }}
asset_name: ${{ needs.build_x86.outputs.setup_32 }}
asset_content_type: application/vnd.microsoft.portable-executable

- name: Upload x64 release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: _setup64/${{ needs.build_x64.outputs.setup_64 }}
asset_name: ${{ needs.build_x64.outputs.setup_64 }}
asset_content_type: application/vnd.microsoft.portable-executable

###########################################
# Required secrets:
# SSH_KNOWN_HOSTS - output of "ssh-keyscan -p <port> <target_host>"
# SSH_PORT - sshd port on <target_host>
# SSH_PRIVATE_KEY - user's private key
# SSH_TARGET - <target_host>:/path/to/dir
# SSH_USER - username to login with
###########################################
- name: Upload assets to vixenlights.com
shell: bash
run: |
if [[ -z "${{ secrets.SSH_TARGET }}" ]] ;then
exit 0
fi
TARGET_EXTRA=
if [[ "${{ needs.setup.outputs.pre_release }}" = "false" ]] ;then
TARGET_EXTRA=/releases
fi
mkdir -p ~/.ssh
touch ~/.ssh/id_rsa ~/.ssh/known_hosts
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa ~/.ssh/known_hosts
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
scp \
-P ${{ secrets.SSH_PORT }} \
-o CheckHostIP=no \
-o StrictHostKeyChecking=yes \
-o NumberOfPasswordPrompts=0 \
_setup32/${{ needs.build_x86.outputs.setup_32 }} \
_setup64/${{ needs.build_x64.outputs.setup_64 }} \
${{ secrets.SSH_USER }}@${{ secrets.SSH_TARGET }}${TARGET_EXTRA}
11 changes: 11 additions & 0 deletions Build/CreateReleaseNotes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ foreach ($type in $issueMap.keys)
$output += "`r`n"
}

# Store the release notes as Github Actions output to use in release body
$actionsOutput = $output.Trim()
# Transform into markdown
$actionsOutput = $actionsOutput -replace '\A', '## '
$actionsOutput = $actionsOutput -replace '(?m)^\*\* ', '### '
$actionsOutput = $actionsOutput -replace '(?m)^ \* ', '* '
# set-env doesn't like multiline strings - escape CR/LF
$actionsOutput = $actionsOutput -replace '%', '%25'
$actionsOutput = $actionsOutput -replace "`r", '%0D'
$actionsOutput = $actionsOutput -replace "`n", '%0A'
Write-Host "::set-env name=VIX_RELEASE_NOTES_MARKDOWN::$actionsOutput"

$file = './Release Notes.txt'
$regex = '^Release Notes - Vixen 3$'
Expand Down
4 changes: 2 additions & 2 deletions Common/ffmpeg/ffmpeg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public void MakeThumbnails(int width, int height, string outputPath, int framesP
}

//Native Video Effect
public void MakeScaledThumbNails(string outputPath, double startPosition, double duration, int width, int height, bool maintainAspect, int rotateVideo, string cropVideo)
public void MakeScaledThumbNails(string outputPath, double startPosition, double duration, int width, int height, bool maintainAspect, int rotateVideo, string cropVideo, int fps=20)
{
int maintainAspectValue = maintainAspect ? -1 : height;
//make arguements string
string args = $" -y -ss {startPosition} -i \"{_movieFile}\" -an -t {duration.ToString(CultureInfo.InvariantCulture)} -vf \"scale={width}:{maintainAspectValue}{cropVideo}, rotate={rotateVideo}*(PI/180)\" -r 20 \"{outputPath}\\%5d.bmp\"";
string args = $" -y -ss {startPosition} -i \"{_movieFile}\" -an -t {duration.ToString(CultureInfo.InvariantCulture)} -vf \"scale={width}:{maintainAspectValue}{cropVideo}, rotate={rotateVideo}*(PI/180)\" -r {fps} \"{outputPath}\\%5d.bmp\"";
string ffmpegPath = AppDomain.CurrentDomain.BaseDirectory;
ffmpegPath += "Common\\ffmpeg.exe";

Expand Down
1 change: 1 addition & 0 deletions Modules/App/CustomPropEditor/Model/Prop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public Prop()
Name = "New Prop";
CreationDate = DateTime.Now;
ModifiedDate = CreationDate;
CreatedBy = Environment.UserName;
VendorMetadata = new VendorMetadata();
PhysicalMetadata = new PhysicalMetadata();
InformationMetadata = new InformationMetadata();
Expand Down
Loading

0 comments on commit 377fa67

Please sign in to comment.