Skip to content

Update GitHub pipeline #156

Update GitHub pipeline

Update GitHub pipeline #156

Workflow file for this run

name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
on:
push:
branches:
- dev
- future
tags:
- v[0-9]+.[0-9]+.[0-9]+ # Matches all semantic versioning tags with major, minor, patch
pull_request:
branches:
- dev
- future
env:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '5.0.403'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
Build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 12.22.x
- name: Install Python 2.7 via Chocolatey
shell: pwsh
run: |
choco install python2 -y
$env:Path += ";C:\Python27"
npm config set python "C:\Python27\python.exe"
- name: Download Visual Studio Build Tools 2019 Installer
run: |
Invoke-WebRequest -Uri https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile vs_buildtools.exe
- name: Install Build Tools ohne Python
shell: powershell
run: |
Start-Process -FilePath ".\vs_buildtools.exe" -ArgumentList @("--quiet", "--norestart", "--add", "Microsoft.VisualStudio.Workload.VCTools", "--add", "Microsoft.VisualStudio.Workload.MSBuildTools", "--add", "Microsoft.VisualStudio.Component.Windows10SDK.18362", "--includeRecommended", "--log", "install.log") -Wait
- name: Set msvs_version for node-gyp
run: npm config set msvs_version 2019
#- name: Check for cl.exe (C++ Compiler)
# shell: powershell
# run: |
# if (Get-Command cl.exe -ErrorAction SilentlyContinue) {
# Write-Host "cl.exe found"
# } else {
# Write-Error "cl.exe not found"
# }
#- name: Check for msbuild.exe
# shell: powershell
# run: |
# if (Get-Command msbuild.exe -ErrorAction SilentlyContinue) {
# Write-Host "msbuild.exe found"
# } else {
# Write-Error "msbuild.exe not found"
# }
- name: Check for Visual Studio Build Tools via vswhere
shell: powershell
run: |
$vswhere = "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
if (Test-Path $vswhere) {
& $vswhere -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
} else {
Write-Error "vswhere.exe not found"
}
- name: Find Visual Studio 2019 installation path
id: vswhere
shell: powershell
run: |
$vsPath = & "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -version 16.0 -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
echo "VS2019_PATH=$vsPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install latest node-gyp in VS 2019 environment
shell: cmd
run: |
"%VS2019_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 && npm install -g node-gyp@8.4.1
#- name: Install windows-build-tools
# run: |
# npm install --global windows-build-tools --vs2019
# shell: pwsh
#- name: TypeScript 3.3.4000 installieren
# run: npm install typescript@3.3.4000
- name: Build HTML
shell: cmd
run: |
"%VS2019_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 && powershell -ExecutionPolicy Bypass -File .\Build.ps1 -SetAssemblyVersion -BuildHtml
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.dotnet_sdk_version }}
- name: Build
shell: pwsh
run: ./Build.ps1 -Build -Pack
- name: Upload package artifacts
uses: actions/upload-artifact@v4
with:
name: packages
path: artifacts/Packages/
retention-days: 1
Documentation:
needs: [Build]
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: Generate docFx
shell: pwsh
run: ./Build.ps1 -GenerateDocs
- name: Upload documentation results
uses: actions/upload-artifact@v4
with:
name: documentation
path: artifacts/Documentation/
retention-days: 1
Publish:
needs: [Build]
if: (github.event_name == 'push')
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.dotnet_sdk_version }}
- name: Download package artifacts
uses: actions/download-artifact@v2
with:
name: packages
path: artifacts/Packages/
- name: Publish on MyGet-CI
if: ${{ github.ref == 'refs/heads/dev' }} # dev branche is published to myget moryx
shell: pwsh
env:
MORYX_NUGET_APIKEY: ${{secrets.MYGET_TOKEN}}
MORYX_PACKAGE_TARGET: "https://www.myget.org/F/moryx/api/v2/package"
MORYX_PACKAGE_TARGET_V3: "https://www.myget.org/F/moryx/api/v3/index.json"
run: ./Build.ps1 -Publish
- name: Publish on MyGet-Future
if: ${{ github.ref == 'refs/heads/future' }} # Future branch is published to myget moryx-future
shell: pwsh
env:
MORYX_NUGET_APIKEY: ${{secrets.MYGET_TOKEN}}
MORYX_PACKAGE_TARGET: "https://www.myget.org/F/moryx-future/api/v2/package"
MORYX_PACKAGE_TARGET_V3: "https://www.myget.org/F/moryx-future/api/v3/index.json"
run: ./Build.ps1 -Publish
- name: Publish on NuGet
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Version Tags are published to nuget
shell: pwsh
env:
MORYX_NUGET_APIKEY: ${{secrets.NUGET_TOKEN}}
MORYX_PACKAGE_TARGET: "https://api.nuget.org/v3/index.json"
MORYX_PACKAGE_TARGET_V3: "https://api.nuget.org/v3/index.json"
run: ./Build.ps1 -Publish