forked from PowerShell/AIShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmac-package.yml
More file actions
78 lines (67 loc) · 2.74 KB
/
Copy pathmac-package.yml
File metadata and controls
78 lines (67 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
parameters:
architecture: x64
jobs:
- job: package_${{ parameters.architecture }}
displayName: Package macOS ${{ parameters.architecture }}
condition: succeeded()
pool:
type: linux
isCustom: true
name: Azure Pipelines
vmImage: 'macOS-latest'
variables:
- name: HOMEBREW_NO_ANALYTICS
value: 1
- name: runCodesignValidationInjection
value: false
- name: nugetMultiFeedWarnLevel
value: none
- name: NugetSecurityAnalysisWarningLevel
value: none
- name: skipNugetSecurityAnalysis
value: true
- group: DotNetPrivateBuildAccess
- name: ob_sdl_sbom_enabled
value: true
- name: ob_sdl_codeql_compiled_enabled
value: false
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
- name: repoRoot
value: $(Build.SourcesDirectory)
- name: Architecture
value: ${{ parameters.architecture }}
steps:
- checkout: self
clean: true
- pwsh: |
Get-ChildItem -Path env:
displayName: Capture environment
- download: AIShellBuildPipeline
artifact: drop_macos_sign_$(Architecture)
- pwsh: |
$signedFilesPath = "$(Pipeline.Workspace)/AIShellBuildPipeline/drop_macos_sign_$(Architecture)"
Write-Verbose -Verbose "Downloaded artifacts:"
Get-ChildItem $signedFilesPath -Recurse | Out-String -Width 500 -Stream
$version = (Get-Item "$signedFilesPath/AIShell.Abstraction.dll").VersionInfo.ProductVersion
$vstsCommandString = "vso[task.setvariable variable=PackageVersion]$version"
Write-Host ("sending " + $vstsCommandString)
Write-Host "##$vstsCommandString"
displayName: 'List downloaded files'
# Diagnostics is not critical it passes every time it runs
continueOnError: true
- pwsh: |
Import-Module $(repoRoot)/tools/packaging -Force
$signedFilesPath = "$(Pipeline.Workspace)/AIShellBuildPipeline/drop_macos_sign_$(Architecture)"
Write-Verbose -Message "Checking 'aish' exists in '$signedFilesPath'" -Verbose
if (-not (Test-Path $signedFilesPath/aish)) {
throw "aish not found in $signedFilesPath"
}
$macosRuntime = "osx-$(Architecture)"
$outDir = "$(Pipeline.Workspace)/AIShellBuildPipeline/pkgs"
$null = New-Item -ItemType Directory $outDir
New-TarballPackage -PackageSourcePath $signedFilesPath -Version $(PackageVersion) -Architecture $(Architecture) -CurrentLocation $outDir -Force
$tarPkgNameFilter = "AIShell-*$macosRuntime.tar.gz"
$tarPkgPath = Get-ChildItem -Path $outDir -Filter $tarPkgNameFilter -Recurse -File | ForEach-Object FullName
Write-Host "##vso[artifact.upload containerfolder=macos-pkgs;artifactname=macos-pkgs]$tarPkgPath"
displayName: 'Package $(Architecture)'