Skip to content

Commit

Permalink
Huge overhaul of core internals
Browse files Browse the repository at this point in the history
- Migrate to .NET 6
- Deprecate EasyHook in favor of a custom CLR + Detours logic ( helps us keeping code scaling in future )
- Use native Powershell instead of the library
- .ci/prepare.ps1: Enable vcpkg integration with Visual Studio
- .ci/package.ps1: Use the new release path
- .ci/azure.yml: Enable vcpkg integration
- .ci/azure.yml: Use the latest NuGet 6.x
- .ci/azure.yml: Enable parallel builds
- .iss/installer.iss: Use the new release path

Thanks to Benjamin Moir <https://github.com/DaZombieKiller> for helping on this huge milestone! You rock!
  • Loading branch information
julianxhokaxhiu committed Oct 28, 2022
1 parent cdfc40d commit bc2ef07
Show file tree
Hide file tree
Showing 52 changed files with 2,561 additions and 2,424 deletions.
32 changes: 25 additions & 7 deletions .ci/azure.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Azure Pipeline YAML file

name: 2.7.1$(Rev:.r)
name: 2.9.9$(Rev:.r)

trigger:
batch: true
Expand All @@ -16,21 +16,29 @@ pr:

variables:
_IS_BUILD_CANARY: false
_IS_GITHUB_RELEASE: false
_RELEASE_NAME: 7thHeaven
_RELEASE_VERSION: v0
_RELEASE_CONFIGURATION: Release
_BUILD_VERSION: $(Build.BuildNumber)
_BUILD_BRANCH: $(Build.SourceBranch)
# VCPKG: Enable Binary Caching
VCPKG_BINARY_SOURCES: clear;nuget,https://pkgs.dev.azure.com/julianxhokaxhiu/Github/_packaging/7thHeaven/nuget/v3/index.json,readwrite
# GIT: Fix reporting from stderr to stdout
GIT_REDIRECT_STDERR: 2>&1

pool:
vmImage: 'windows-2022'

steps:
- checkout: self
- task: NuGetAuthenticate@1
- task: PowerShell@2
displayName: 'Prepare $(_RELEASE_NAME) Env'
inputs:
filePath: $(Build.Repository.LocalPath)\.ci\prepare.ps1
failOnStderr: true
pwsh: true
- task: bleddynrichards.Assembly-Info-Task.Assembly-Info-Task.Assembly-Info-NetFramework@2
displayName: 'Set $(_RELEASE_NAME) Assembly Manifest Data'
inputs:
Expand All @@ -43,7 +51,7 @@ steps:
InformationalVersion: $(_BUILD_VERSION)
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.x
versionSpec: 6.x
checkLatest: true
- task: NuGetCommand@2
displayName: 'Restore $(_RELEASE_NAME) NuGet Packages'
Expand All @@ -56,23 +64,33 @@ steps:
solution: $(Build.Repository.LocalPath)\$(_RELEASE_NAME).sln
platform: Any CPU
configuration: $(_RELEASE_CONFIGURATION)
msbuildArgs: /p:WindowsTargetPlatformVersion=10.0.19041.0
msbuildArgs: /p:WindowsTargetPlatformVersion=10.0.19041.0 /m
- task: PowerShell@2
condition: and(not(contains(variables._BUILD_BRANCH, 'refs/pull/')), succeeded())
displayName: 'Package $(_RELEASE_NAME)'
inputs:
filePath: $(Build.Repository.LocalPath)\.ci\package.ps1
failOnStderr: true
pwsh: true
env:
buildPath: $(Build.Repository.LocalPath)
- task: PowerShell@2
condition: and(not(contains(variables._BUILD_BRANCH, 'refs/pull/')), succeeded())
displayName: 'Prepare $(_RELEASE_NAME) Installer'
inputs:
filePath: $(Build.Repository.LocalPath)\.iss\build.ps1
failOnStderr: true
pwsh: true
env:
buildPath: $(Build.Repository.LocalPath)
- task: PublishPipelineArtifact@1
displayName: 'Publish $(_RELEASE_NAME) Artifact'
condition: and(eq(variables._IS_GITHUB_RELEASE, 'false'), succeeded())
inputs:
targetPath: .dist\
artifactName: $(_RELEASE_NAME)-$(_RELEASE_VERSION)
- task: GitHubRelease@0
condition: and(eq(variables._IS_BUILD_CANARY, 'true'), not(contains(variables._BUILD_BRANCH, 'refs/pull/')), succeeded())
condition: and(eq(variables._IS_GITHUB_RELEASE, 'true'), eq(variables._IS_BUILD_CANARY, 'true'), succeeded())
displayName: 'Delete $(_RELEASE_NAME) Release (Canary)'
continueOnError: true
inputs:
Expand All @@ -81,7 +99,7 @@ steps:
tagSource: manual
tag: canary
- task: GitHubRelease@0
condition: and(eq(variables._IS_BUILD_CANARY, 'true'), not(contains(variables._BUILD_BRANCH, 'refs/pull/')), succeeded())
condition: and(eq(variables._IS_GITHUB_RELEASE, 'true'), eq(variables._IS_BUILD_CANARY, 'true'), succeeded())
displayName: 'Create $(_RELEASE_NAME) Release (Canary)'
inputs:
gitHubConnection: github_ci
Expand All @@ -94,14 +112,14 @@ steps:
releaseNotes: |
This is a canary build. Please be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!
- task: GitHubRelease@0
condition: and(eq(variables._IS_BUILD_CANARY, 'false'), not(contains(variables._BUILD_BRANCH, 'refs/pull/')), succeeded())
condition: and(eq(variables._IS_GITHUB_RELEASE, 'true'), eq(variables._IS_BUILD_CANARY, 'false'), succeeded())
displayName: 'Create $(_RELEASE_NAME) Release (Stable)'
inputs:
gitHubConnection: github_ci
assets: $(Build.Repository.LocalPath)\.dist\*
title: $(_RELEASE_NAME)-$(_RELEASE_VERSION)
- task: PowerShell@2
condition: and(not(contains(variables._BUILD_BRANCH, 'refs/pull/')), succeeded())
condition: and(eq(variables._IS_GITHUB_RELEASE, 'true'), succeeded())
displayName: 'Alert the $(_RELEASE_NAME) Release'
inputs:
filePath: .ci\alert.ps1
Expand Down
2 changes: 1 addition & 1 deletion .ci/package.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mkdir ${env:buildPath}\.dist | Out-Null

Set-Location ${env:buildPath}\SeventhHeavenUI\bin\Release
Set-Location "${env:buildPath}\SeventhHeavenUI\bin\Release\net6.0-windows"
7z a "${env:buildPath}\.dist\${env:_RELEASE_NAME}-${env:_RELEASE_VERSION}_${env:_RELEASE_CONFIGURATION}.zip" ".\*"
22 changes: 22 additions & 0 deletions .ci/prepare.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
if ($env:_BUILD_BRANCH -eq "refs/heads/master" -Or $env:_BUILD_BRANCH -eq "refs/tags/canary") {
$env:_IS_BUILD_CANARY = "true"
$env:_IS_GITHUB_RELEASE = "true"
}
elseif ($env:_BUILD_BRANCH -like "refs/tags/*") {
$env:_BUILD_VERSION = $env:_BUILD_VERSION.Substring(0, $env:_BUILD_VERSION.LastIndexOf('.')) + ".0"
$env:_IS_GITHUB_RELEASE = "true"
}
$env:_RELEASE_VERSION = "v${env:_BUILD_VERSION}"

$vcpkgRoot = "C:\vcpkg"
$vcpkgBaseline = [string](jq --arg baseline "builtin-baseline" -r '.[$baseline]' 7thWrapperLoader/vcpkg.json)
$vcpkgOriginUrl = &"git" -C $vcpkgRoot remote get-url origin
$vcpkgBranchName = &"git" -C $vcpkgRoot branch --show-current

Write-Output "--------------------------------------------------"
Write-Output "BUILD CONFIGURATION: $env:_RELEASE_CONFIGURATION"
Write-Output "RELEASE VERSION: $env:_RELEASE_VERSION"
Write-Output "VCPKG ORIGIN: $vcpkgOriginUrl"
Write-Output "VCPKG BRANCH: $vcpkgBranchName"
Write-Output "VCPKG BASELINE: $vcpkgBaseline"
Write-Output "--------------------------------------------------"

Write-Host "##vso[task.setvariable variable=_BUILD_VERSION;]${env:_BUILD_VERSION}"
Write-Host "##vso[task.setvariable variable=_RELEASE_VERSION;]${env:_RELEASE_VERSION}"
Write-Host "##vso[task.setvariable variable=_IS_BUILD_CANARY;]${env:_IS_BUILD_CANARY}"
Write-Host "##vso[task.setvariable variable=_IS_GITHUB_RELEASE;]${env:_IS_GITHUB_RELEASE}"

git -C $vcpkgRoot pull --all
git -C $vcpkgRoot checkout $vcpkgBaseline
git -C $vcpkgRoot clean -fxd

cmd.exe /c "call $vcpkgRoot\bootstrap-vcpkg.bat"

mkdir "C:\vcpkg\downloads\tools\yasm\1.3.0.6" | Out-Null
Invoke-WebRequest -Uri "http://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe" -SkipCertificateCheck -OutFile "C:\vcpkg\downloads\tools\yasm\1.3.0.6\yasm.exe"

vcpkg integrate install
Loading

0 comments on commit bc2ef07

Please sign in to comment.