Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macOS ARM64, add Windows nuget restore workaround #180

Merged
merged 3 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions ci/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ trigger:

variables:
- group: wayknow
- name: openssl_version
value: 1.1.1b-5

stages:
- stage: Get_version
Expand Down Expand Up @@ -264,6 +262,50 @@ stages:
pathToPublish: $(Build.StagingDirectory)
artifactName: jetsocat

- job: Macos_arm64
pool:
name: 'Devolutions - macOS'

workspace:
clean: all

variables:
TargetPlatform: "macos"
TargetArchitecture: "arm64"

steps:
- checkout: self
clean: true
fetchDepth: 1

- powershell: |
$PackageVersion = Get-Content "$(Build.Repository.LocalPath)\VERSION"
$TargetOutputPath = "$(Build.StagingDirectory)/$(TargetPlatform)/$(TargetArchitecture)"
$ExecutableFileName = "jetsocat_$(TargetPlatform)_${PackageVersion}_$(TargetArchitecture)"
$JetsocatExecutable = "$TargetOutputPath/$ExecutableFileName"
$CargoPackage = "jetsocat"
Write-Host "##vso[task.setvariable variable=PackageVersion]$PackageVersion"
Write-Host "##vso[task.setvariable variable=TargetOutputPath]$TargetOutputPath"
Write-Host "##vso[task.setvariable variable=JetsocatExecutable]$JetsocatExecutable"
Write-Host "##vso[task.setvariable variable=CargoPackage]$CargoPackage"
displayName: Load dynamic variables

- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: $(System.DefaultWorkingDirectory)/ci/tlk.ps1
arguments: build -Platform $(TargetPlatform) -Architecture $(TargetArchitecture)
env:
TARGET_OUTPUT_PATH: "$(TargetOutputPath)"
JETSOCAT_EXECUTABLE: "$(JetsocatExecutable)"
CARGO_PACKAGE: "$(CargoPackage)"
displayName: Building jetsocat

- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.StagingDirectory)
artifactName: jetsocat

- stage: 'Devolutions_Gateway'
jobs:
- job: Linux_64_bit
Expand Down
11 changes: 8 additions & 3 deletions ci/tlk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ class TlkTarget
switch ($this.Architecture) {
"x86" { "i686" }
"x86_64" { "x86_64" }
"x64" { "x86_64" }
"aarch64" { "aarch64" }
"arm64" { "aarch64" }
}

$CargoPlatform = `
Expand Down Expand Up @@ -248,17 +250,19 @@ class TlkRecipe
}

[void] Build() {
$OPENSSL_VERSION = '1.1.1b-5'
$OPENSSL_VERSION = '1.1.1d-4'
$ConanPackage = "openssl/${OPENSSL_VERSION}@devolutions/stable"
$ConanProfile = "$($this.Target.Platform)-$($this.Target.Architecture)"

Write-Host "conan profile: $ConanProfile"

$BuildStagingDirectory = Join-Path $this.SourcePath "artifacts"

if (Test-Path Env:TARGET_OUTPUT_PATH) {
$BuildStagingDirectory = $Env:TARGET_OUTPUT_PATH
}

if (-Not $this.Target.IsMacOS()) {
#if (-Not $this.Target.IsMacOS()) {
# FIXME: this fails on CI build machines for macOS, maybe conan is outdated?

& 'conan' 'install' $ConanPackage '-g' 'virtualenv' '-pr' $ConanProfile
Expand All @@ -270,7 +274,7 @@ class TlkRecipe

$OPENSSL_DIR = $dotenv['OPENSSL_DIR']
$Env:OPENSSL_DIR = $OPENSSL_DIR
}
#}

if ($this.Target.IsWindows()) {
$Env:RUSTFLAGS = "-C target-feature=+crt-static"
Expand All @@ -289,6 +293,7 @@ class TlkRecipe
Set-Location -Path $CargoPackage

$CargoTarget = $this.Target.CargoTarget()
Write-Host "CargoTarget: $CargoTarget"

$CargoArgs = @('build', '--release')
$CargoArgs += @('--target', $CargoTarget)
Expand Down
2 changes: 2 additions & 0 deletions powershell/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ $Env:NUGET_CERT_REVOCATION_MODE='offline'

& dotnet nuget add source "https://api.nuget.org/v3/index.json" -n "nuget.org" | Out-Null

& dotnet restore "$PSScriptRoot\$ModuleName\src" 2>&1>$null

& dotnet publish "$PSScriptRoot\$ModuleName\src" -f netstandard2.0 -c Release -o "$PSScriptRoot\$ModuleName\bin"

Copy-Item "$PSScriptRoot\$ModuleName\bin" -Destination "$PSModuleOutputPath\$ModuleName" -Recurse -Force
Expand Down
33 changes: 0 additions & 33 deletions powershell/ci/azure-pipelines.yml

This file was deleted.