diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67aeb533cbb..b1ab891546f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: build: strategy: matrix: - runtime: [ linux-x64, linux-arm64, linux-arm, win-x64, osx-x64, osx-arm64 ] + runtime: [ linux-x64, linux-arm64, linux-arm, win-x64, win-arm64, osx-x64, osx-arm64 ] include: - runtime: linux-x64 os: ubuntu-latest @@ -44,6 +44,10 @@ jobs: os: windows-2019 devScript: ./dev + - runtime: win-arm64 + os: windows-latest + devScript: ./dev + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -82,7 +86,7 @@ jobs: run: | ${{ matrix.devScript }} test working-directory: src - if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm' && matrix.runtime != 'osx-arm64' + if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm' && matrix.runtime != 'osx-arm64' && matrix.runtime != 'win-arm64' # Create runner package tar.gz/zip - name: Package Release @@ -97,7 +101,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: runner-package-${{ matrix.runtime }} - path: | + path: | _package _package_trims/trim_externals _package_trims/trim_runtime diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3ec84623ce..20927e2176f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,29 +50,33 @@ jobs: linux-arm64-sha: ${{ steps.sha.outputs.linux-arm64-sha256 }} linux-arm-sha: ${{ steps.sha.outputs.linux-arm-sha256 }} win-x64-sha: ${{ steps.sha.outputs.win-x64-sha256 }} + win-arm64-sha: ${{ steps.sha.outputs.win-arm64-sha256 }} osx-x64-sha: ${{ steps.sha.outputs.osx-x64-sha256 }} osx-arm64-sha: ${{ steps.sha.outputs.osx-arm64-sha256 }} linux-x64-sha-noexternals: ${{ steps.sha_noexternals.outputs.linux-x64-sha256 }} linux-arm64-sha-noexternals: ${{ steps.sha_noexternals.outputs.linux-arm64-sha256 }} linux-arm-sha-noexternals: ${{ steps.sha_noexternals.outputs.linux-arm-sha256 }} win-x64-sha-noexternals: ${{ steps.sha_noexternals.outputs.win-x64-sha256 }} + win-arm64-sha-noexternals: ${{ steps.sha_noexternals.outputs.win-arm64-sha256 }} osx-x64-sha-noexternals: ${{ steps.sha_noexternals.outputs.osx-x64-sha256 }} osx-arm64-sha-noexternals: ${{ steps.sha_noexternals.outputs.osx-arm64-sha256 }} linux-x64-sha-noruntime: ${{ steps.sha_noruntime.outputs.linux-x64-sha256 }} linux-arm64-sha-noruntime: ${{ steps.sha_noruntime.outputs.linux-arm64-sha256 }} linux-arm-sha-noruntime: ${{ steps.sha_noruntime.outputs.linux-arm-sha256 }} win-x64-sha-noruntime: ${{ steps.sha_noruntime.outputs.win-x64-sha256 }} + win-arm64-sha-noruntime: ${{ steps.sha_noruntime.outputs.win-arm64-sha256 }} osx-x64-sha-noruntime: ${{ steps.sha_noruntime.outputs.osx-x64-sha256 }} osx-arm64-sha-noruntime: ${{ steps.sha_noruntime.outputs.osx-arm64-sha256 }} linux-x64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.linux-x64-sha256 }} linux-arm64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.linux-arm64-sha256 }} linux-arm-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.linux-arm-sha256 }} win-x64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.win-x64-sha256 }} + win-arm64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.win-arm64-sha256 }} osx-x64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.osx-x64-sha256 }} osx-arm64-sha-noruntime-noexternals: ${{ steps.sha_noruntime_noexternals.outputs.osx-arm64-sha256 }} strategy: matrix: - runtime: [ linux-x64, linux-arm64, linux-arm, win-x64, osx-x64, osx-arm64 ] + runtime: [ linux-x64, linux-arm64, linux-arm, win-x64, osx-x64, osx-arm64, win-arm64 ] include: - runtime: linux-x64 os: ubuntu-latest @@ -89,7 +93,7 @@ jobs: - runtime: osx-x64 os: macOS-latest devScript: ./dev.sh - + - runtime: osx-arm64 os: macOS-latest devScript: ./dev.sh @@ -98,6 +102,10 @@ jobs: os: windows-2019 devScript: ./dev + - runtime: win-arm64 + os: windows-latest + devScript: ./dev + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -158,9 +166,9 @@ jobs: id: sha_noruntime_noexternals name: Compute SHA256 working-directory: _package_trims/trim_runtime_externals - + - name: Create trimmedpackages.json for ${{ matrix.runtime }} - if: matrix.runtime == 'win-x64' + if: matrix.runtime == 'win-x64' || matrix.runtime == 'win-arm64' uses: actions/github-script@0.3.0 with: github-token: ${{secrets.GITHUB_TOKEN}} @@ -180,7 +188,7 @@ jobs: fs.writeFileSync('${{ matrix.runtime }}-trimmedpackages.json', trimmedPackages) - name: Create trimmedpackages.json for ${{ matrix.runtime }} - if: matrix.runtime != 'win-x64' + if: matrix.runtime != 'win-x64' && matrix.runtime != 'win-arm64' uses: actions/github-script@0.3.0 with: github-token: ${{secrets.GITHUB_TOKEN}} @@ -239,24 +247,28 @@ jobs: const runnerVersion = fs.readFileSync('${{ github.workspace }}/src/runnerversion', 'utf8').replace(/\n$/g, '') var releaseNote = fs.readFileSync('${{ github.workspace }}/releaseNote.md', 'utf8').replace(//g, runnerVersion) releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.win-x64-sha}}') + releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.win-arm64-sha}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.osx-x64-sha}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.osx-arm64-sha}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-x64-sha}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-arm-sha}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-arm64-sha}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.win-x64-sha-noexternals}}') + releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.win-arm64-sha-noexternals}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.osx-x64-sha-noexternals}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.osx-arm64-sha-noexternals}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-x64-sha-noexternals}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-arm-sha-noexternals}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-arm64-sha-noexternals}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.win-x64-sha-noruntime}}') + releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.win-arm64-sha-noruntime}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.osx-x64-sha-noruntime}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.osx-arm64-sha-noruntime}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-x64-sha-noruntime}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-arm-sha-noruntime}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-arm64-sha-noruntime}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.win-x64-sha-noruntime-noexternals}}') + releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.win-arm64-sha-noruntime-noexternals}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.osx-x64-sha-noruntime-noexternals}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.osx-arm64-sha-noruntime-noexternals}}') releaseNote = releaseNote.replace(//g, '${{needs.build.outputs.linux-x64-sha-noruntime-noexternals}}') @@ -271,6 +283,7 @@ jobs: run: | ls -l echo "${{needs.build.outputs.win-x64-sha}} actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}.zip" | shasum -a 256 -c + echo "${{needs.build.outputs.win-arm64-sha}} actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}.zip" | shasum -a 256 -c echo "${{needs.build.outputs.osx-x64-sha}} actions-runner-osx-x64-${{ steps.releaseNote.outputs.version }}.tar.gz" | shasum -a 256 -c echo "${{needs.build.outputs.osx-arm64-sha}} actions-runner-osx-arm64-${{ steps.releaseNote.outputs.version }}.tar.gz" | shasum -a 256 -c echo "${{needs.build.outputs.linux-x64-sha}} actions-runner-linux-x64-${{ steps.releaseNote.outputs.version }}.tar.gz" | shasum -a 256 -c @@ -300,6 +313,16 @@ jobs: asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}.zip asset_content_type: application/octet-stream + - name: Upload Release Asset (win-arm64) + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.createRelease.outputs.upload_url }} + asset_path: ${{ github.workspace }}/_package/actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}.zip + asset_name: actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}.zip + asset_content_type: application/octet-stream + - name: Upload Release Asset (linux-x64) uses: actions/upload-release-asset@v1.0.1 env: @@ -361,6 +384,17 @@ jobs: asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-noexternals.zip asset_content_type: application/octet-stream + # Upload release assets (trim externals) + - name: Upload Release Asset (win-arm64-noexternals) + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.createRelease.outputs.upload_url }} + asset_path: ${{ github.workspace }}/_package_trims/trim_externals/actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}-noexternals.zip + asset_name: actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}-noexternals.zip + asset_content_type: application/octet-stream + - name: Upload Release Asset (linux-x64-noexternals) uses: actions/upload-release-asset@v1.0.1 env: @@ -422,6 +456,17 @@ jobs: asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-noruntime.zip asset_content_type: application/octet-stream + # Upload release assets (trim runtime) + - name: Upload Release Asset (win-arm64-noruntime) + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.createRelease.outputs.upload_url }} + asset_path: ${{ github.workspace }}/_package_trims/trim_runtime/actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}-noruntime.zip + asset_name: actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}-noruntime.zip + asset_content_type: application/octet-stream + - name: Upload Release Asset (linux-x64-noruntime) uses: actions/upload-release-asset@v1.0.1 env: @@ -483,6 +528,17 @@ jobs: asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.zip asset_content_type: application/octet-stream + # Upload release assets (trim runtime and externals) + - name: Upload Release Asset (win-arm64-noruntime-noexternals) + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.createRelease.outputs.upload_url }} + asset_path: ${{ github.workspace }}/_package_trims/trim_runtime_externals/actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.zip + asset_name: actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}-noruntime-noexternals.zip + asset_content_type: application/octet-stream + - name: Upload Release Asset (linux-x64-noruntime-noexternals) uses: actions/upload-release-asset@v1.0.1 env: @@ -544,6 +600,17 @@ jobs: asset_name: actions-runner-win-x64-${{ steps.releaseNote.outputs.version }}-trimmedpackages.json asset_content_type: application/octet-stream + # Upload release assets (trimmedpackages.json) + - name: Upload Release Asset (win-arm64-trimmedpackages.json) + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.createRelease.outputs.upload_url }} + asset_path: ${{ github.workspace }}/win-arm64-trimmedpackages.json + asset_name: actions-runner-win-arm64-${{ steps.releaseNote.outputs.version }}-trimmedpackages.json + asset_content_type: application/octet-stream + - name: Upload Release Asset (linux-x64-trimmedpackages.json) uses: actions/upload-release-asset@v1.0.1 env: diff --git a/docs/contribute.md b/docs/contribute.md index fab3563afc7..bb046f4cb9a 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -27,6 +27,8 @@ An ADR is an Architectural Decision Record. This allows consensus on the direct ![Win](res/win_sm.png) Visual Studio 2017 or newer [Install here](https://visualstudio.microsoft.com) (needed for dev sh script) +![Win-arm](res/win_sm.png) Visual Studio 2022 17.3 Preview or later. [Install here](https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview) + ## Quickstart: Run a job from a real repository If you just want to get from building the sourcecode to using it to execute an action, you will need: diff --git a/releaseNote.md b/releaseNote.md index b70766e7098..9392b24cc30 100644 --- a/releaseNote.md +++ b/releaseNote.md @@ -16,6 +16,22 @@ Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD\actions-runner-win-x64-.zip", "$PWD") ``` +## [Pre-release] Windows arm64 +**Warning:** Windows arm64 runners are currently in preview status and use [unofficial versions of nodejs](https://unofficial-builds.nodejs.org/). They are not intended for production workflows. + +We recommend configuring the runner in a root folder of the Windows drive (e.g. "C:\actions-runner"). This will help avoid issues related to service identity folder permissions and long file path restrictions on Windows. + +The following snipped needs to be run on `powershell`: +``` powershell +# Create a folder under the drive root +mkdir \actions-runner ; cd \actions-runner +# Download the latest runner package +Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v/actions-runner-win-arm64-.zip -OutFile actions-runner-win-arm64-.zip +# Extract the installer +Add-Type -AssemblyName System.IO.Compression.FileSystem ; +[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD\actions-runner-win-arm64-.zip", "$PWD") +``` + ## OSX x64 ``` bash @@ -79,6 +95,7 @@ For additional details about configuring, running, or shutting down the runner p The SHA-256 checksums for the packages included in this build are shown below: - actions-runner-win-x64-.zip +- actions-runner-win-arm64-.zip - actions-runner-osx-x64-.tar.gz - actions-runner-osx-arm64-.tar.gz - actions-runner-linux-x64-.tar.gz @@ -86,6 +103,7 @@ The SHA-256 checksums for the packages included in this build are shown below: - actions-runner-linux-arm-.tar.gz - actions-runner-win-x64--noexternals.zip +- actions-runner-win-arm64--noexternals.zip - actions-runner-osx-x64--noexternals.tar.gz - actions-runner-osx-arm64--noexternals.tar.gz - actions-runner-linux-x64--noexternals.tar.gz @@ -93,6 +111,7 @@ The SHA-256 checksums for the packages included in this build are shown below: - actions-runner-linux-arm--noexternals.tar.gz - actions-runner-win-x64--noruntime.zip +- actions-runner-win-arm64--noruntime.zip - actions-runner-osx-x64--noruntime.tar.gz - actions-runner-osx-arm64--noruntime.tar.gz - actions-runner-linux-x64--noruntime.tar.gz @@ -100,6 +119,7 @@ The SHA-256 checksums for the packages included in this build are shown below: - actions-runner-linux-arm--noruntime.tar.gz - actions-runner-win-x64--noruntime-noexternals.zip +- actions-runner-win-arm64--noruntime-noexternals.zip - actions-runner-osx-x64--noruntime-noexternals.tar.gz - actions-runner-osx-arm64--noruntime-noexternals.tar.gz - actions-runner-linux-x64--noruntime-noexternals.tar.gz diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 1931b7f8f08..9db5faca37a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -24,6 +24,9 @@ $(DefineConstants);X86 + + $(DefineConstants);ARM64 + $(DefineConstants);X64 diff --git a/src/Misc/contentHash/dotnetRuntime/win-arm64 b/src/Misc/contentHash/dotnetRuntime/win-arm64 new file mode 100644 index 00000000000..8d279b0417b --- /dev/null +++ b/src/Misc/contentHash/dotnetRuntime/win-arm64 @@ -0,0 +1 @@ +39d0683f0f115a211cb10c473e9574c16549a19d4e9a6c637ded3d7022bf809f diff --git a/src/Misc/contentHash/externals/win-arm64 b/src/Misc/contentHash/externals/win-arm64 new file mode 100644 index 00000000000..bd10bc5ea31 --- /dev/null +++ b/src/Misc/contentHash/externals/win-arm64 @@ -0,0 +1 @@ +e5dace2d41cc0682d096dcce4970079ad48ec7107e46195970eecfdb3df2acef diff --git a/src/Misc/externals.sh b/src/Misc/externals.sh index b11b225f751..123c46ce5bd 100755 --- a/src/Misc/externals.sh +++ b/src/Misc/externals.sh @@ -3,6 +3,7 @@ PACKAGERUNTIME=$1 PRECACHE=$2 NODE_URL=https://nodejs.org/dist +UNOFFICIAL_NODE_URL=https://unofficial-builds.nodejs.org/download/release NODE12_VERSION="12.22.7" NODE16_VERSION="16.13.0" @@ -134,6 +135,16 @@ if [[ "$PACKAGERUNTIME" == "win-x64" || "$PACKAGERUNTIME" == "win-x86" ]]; then fi fi +# Download the external tools only for Windows. +if [[ "$PACKAGERUNTIME" == "win-arm64" ]]; then + # todo: replace these with official release when available + acquireExternalTool "$UNOFFICIAL_NODE_URL/v${NODE16_VERSION}/$PACKAGERUNTIME/node.exe" node16/bin + acquireExternalTool "$UNOFFICIAL_NODE_URL/v${NODE16_VERSION}/$PACKAGERUNTIME/node.lib" node16/bin + if [[ "$PRECACHE" != "" ]]; then + acquireExternalTool "https://github.com/microsoft/vswhere/releases/download/2.6.7/vswhere.exe" vswhere + fi +fi + # Download the external tools only for OSX. if [[ "$PACKAGERUNTIME" == "osx-x64" ]]; then acquireExternalTool "$NODE_URL/v${NODE12_VERSION}/node-v${NODE12_VERSION}-darwin-x64.tar.gz" node12 fix_nested_dir diff --git a/src/Misc/runnerdotnetruntimeassets b/src/Misc/runnerdotnetruntimeassets index 1cbb627713c..fa2d9e04b4c 100644 --- a/src/Misc/runnerdotnetruntimeassets +++ b/src/Misc/runnerdotnetruntimeassets @@ -66,12 +66,14 @@ libmscordbi.dylib libmscordbi.so Microsoft.CSharp.dll Microsoft.DiaSymReader.Native.amd64.dll +Microsoft.DiaSymReader.Native.arm64.dll Microsoft.VisualBasic.Core.dll Microsoft.VisualBasic.dll Microsoft.Win32.Primitives.dll Microsoft.Win32.Registry.dll mscordaccore.dll mscordaccore_amd64_amd64_6.0.522.21309.dll +mscordaccore_arm64_arm64_6.0.522.21309.dll mscordbi.dll mscorlib.dll mscorrc.debug.dll @@ -261,4 +263,4 @@ System.Xml.XmlSerializer.dll System.Xml.XPath.dll System.Xml.XPath.XDocument.dll ucrtbase.dll -WindowsBase.dll \ No newline at end of file +WindowsBase.dll diff --git a/src/Runner.Common/Constants.cs b/src/Runner.Common/Constants.cs index 0e756ae552d..25ccc96132f 100644 --- a/src/Runner.Common/Constants.cs +++ b/src/Runner.Common/Constants.cs @@ -77,7 +77,7 @@ public static class Runner public static readonly Architecture PlatformArchitecture = Architecture.X64; #elif ARM public static readonly Architecture PlatformArchitecture = Architecture.Arm; -#elif ARM64 +#elif ARM64 public static readonly Architecture PlatformArchitecture = Architecture.Arm64; #endif @@ -152,7 +152,7 @@ public static class Features public static readonly string DiskSpaceWarning = "runner.diskspace.warning"; public static readonly string Node12Warning = "DistributedTask.AddWarningToNode12Action"; public static readonly string UseContainerPathForTemplate = "DistributedTask.UseContainerPathForTemplate"; - public static readonly string AllowRunnerContainerHooks = "DistributedTask.AllowRunnerContainerHooks"; + public static readonly string AllowRunnerContainerHooks = "DistributedTask.AllowRunnerContainerHooks"; } public static readonly string InternalTelemetryIssueDataKey = "_internal_telemetry"; @@ -241,8 +241,8 @@ public static class Agent public static readonly string ToolsDirectory = "agent.ToolsDirectory"; // Set this env var to "node12" to downgrade the node version for internal functions (e.g hashfiles). This does NOT affect the version of node actions. - public static readonly string ForcedInternalNodeVersion = "ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION"; - public static readonly string ForcedActionsNodeVersion = "ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION"; + public static readonly string ForcedInternalNodeVersion = "ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION"; + public static readonly string ForcedActionsNodeVersion = "ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION"; } public static class System @@ -255,5 +255,12 @@ public static class System public static readonly string PhaseDisplayName = "system.phaseDisplayName"; } } + + public static class OperatingSystem + { + public static readonly int Windows11BuildVersion = 22000; + // Both windows 10 and windows 11 share the same Major Version 10, need to use the build version to differentiate + public static readonly int Windows11MajorVersion = 10; + } } } diff --git a/src/Runner.Common/Runner.Common.csproj b/src/Runner.Common/Runner.Common.csproj index bfbdc5f2e16..64bf4cda35a 100644 --- a/src/Runner.Common/Runner.Common.csproj +++ b/src/Runner.Common/Runner.Common.csproj @@ -3,7 +3,7 @@ net6.0 Library - win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64 + win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64;win-arm64 true NU1701;NU1603 $(Version) diff --git a/src/Runner.Common/Util/NodeUtil.cs b/src/Runner.Common/Util/NodeUtil.cs index 8fbf53bdf52..a9cbfc6df21 100644 --- a/src/Runner.Common/Util/NodeUtil.cs +++ b/src/Runner.Common/Util/NodeUtil.cs @@ -7,7 +7,7 @@ public static class NodeUtil { private const string _defaultNodeVersion = "node16"; -#if OS_OSX && ARM64 +#if (OS_OSX || OS_WINDOWS) && ARM64 public static readonly ReadOnlyCollection BuiltInNodeVersions = new(new[] { "node16" }); #else public static readonly ReadOnlyCollection BuiltInNodeVersions = new(new[] { "node12", "node16" }); diff --git a/src/Runner.Listener/Program.cs b/src/Runner.Listener/Program.cs index 537cda1c71e..71d5f9c580b 100644 --- a/src/Runner.Listener/Program.cs +++ b/src/Runner.Listener/Program.cs @@ -60,6 +60,18 @@ private async static Task MainAsync(IHostContext context, string[] args) terminal.WriteLine("This runner version is built for Windows. Please install a correct build for your OS."); return Constants.Runner.ReturnCode.TerminatedError; } + #if ARM64 + // A little hacky, but windows gives no way to differentiate between windows 10 and 11. + // By default only 11 supports native x64 app emulation on arm, so we only want to support windows 11 + // https://docs.microsoft.com/en-us/windows/arm/overview#build-windows-apps-that-run-on-arm + // Windows 10 and 11 share a MajorVersion, so we also check the build version. Minor for both is 0, so doing < 0 doesn't really make a lot of sense. + if (Environment.OSVersion.Version.Major < Constants.OperatingSystem.Windows11MajorVersion || + Environment.OSVersion.Version.Build < Constants.OperatingSystem.Windows11BuildVersion) + { + terminal.WriteLine("Win-arm64 runners require windows 11 or later. Please upgrade your operating system."); + return Constants.Runner.ReturnCode.TerminatedError; + } + #endif break; default: terminal.WriteLine($"Running the runner on this platform is not supported. The current platform is {RuntimeInformation.OSDescription} and it was built for {Constants.Runner.Platform.ToString()}."); diff --git a/src/Runner.Listener/Runner.Listener.csproj b/src/Runner.Listener/Runner.Listener.csproj index 4298c753079..577847891be 100644 --- a/src/Runner.Listener/Runner.Listener.csproj +++ b/src/Runner.Listener/Runner.Listener.csproj @@ -3,7 +3,7 @@ net6.0 Exe - win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64 + win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64;win-arm64 true NU1701;NU1603 $(Version) diff --git a/src/Runner.PluginHost/Runner.PluginHost.csproj b/src/Runner.PluginHost/Runner.PluginHost.csproj index 7937a25164d..df30f3450a2 100644 --- a/src/Runner.PluginHost/Runner.PluginHost.csproj +++ b/src/Runner.PluginHost/Runner.PluginHost.csproj @@ -3,7 +3,7 @@ net6.0 Exe - win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64 + win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64;win-arm64 true NU1701;NU1603 $(Version) diff --git a/src/Runner.Plugins/Runner.Plugins.csproj b/src/Runner.Plugins/Runner.Plugins.csproj index 8314aea5187..39245a3f7a7 100644 --- a/src/Runner.Plugins/Runner.Plugins.csproj +++ b/src/Runner.Plugins/Runner.Plugins.csproj @@ -3,7 +3,7 @@ net6.0 Library - win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64 + win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64;win-arm64 true NU1701;NU1603 $(Version) diff --git a/src/Runner.Sdk/Runner.Sdk.csproj b/src/Runner.Sdk/Runner.Sdk.csproj index 63d6c0e186d..202e8669a64 100644 --- a/src/Runner.Sdk/Runner.Sdk.csproj +++ b/src/Runner.Sdk/Runner.Sdk.csproj @@ -3,12 +3,12 @@ net6.0 Library - win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64 + win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64;win-arm64 true NU1701;NU1603 $(Version) - + diff --git a/src/Runner.Service/Windows/App.config b/src/Runner.Service/Windows/App.config index 8e15646352e..486e3ea0979 100644 --- a/src/Runner.Service/Windows/App.config +++ b/src/Runner.Service/Windows/App.config @@ -1,6 +1,6 @@  - + - \ No newline at end of file + diff --git a/src/Runner.Service/Windows/AppARM.config b/src/Runner.Service/Windows/AppARM.config new file mode 100644 index 00000000000..ca9f6a32e67 --- /dev/null +++ b/src/Runner.Service/Windows/AppARM.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Runner.Service/Windows/RunnerService.csproj b/src/Runner.Service/Windows/RunnerService.csproj index 73fe4ecc655..238e67aac6e 100644 --- a/src/Runner.Service/Windows/RunnerService.csproj +++ b/src/Runner.Service/Windows/RunnerService.csproj @@ -11,10 +11,15 @@ RunnerService false false - v4.5 512 true + + v4.8 + + + v4.5 + AnyCPU true @@ -61,7 +66,10 @@ Resource.resx - + + + + @@ -71,7 +79,7 @@ -