diff --git a/azure-pipelines-photino.native-dev.yml b/azure-pipelines-photino.native-dev.yml index 4aaae58..0ae9d2f 100644 --- a/azure-pipelines-photino.native-dev.yml +++ b/azure-pipelines-photino.native-dev.yml @@ -51,7 +51,7 @@ jobs: # Windows x64 - task: NuGetCommand@2 - displayName: 'NuGet package restore for Windows (intel) native packages' + displayName: 'NuGet package restore for Windows (x64)' condition: eq(variables.rid, 'win-x64') inputs: command: 'restore' @@ -59,7 +59,7 @@ jobs: feedsToUse: 'select' - task: VSBuild@1 - displayName: 'Build Windows (intel) native assets' + displayName: 'Build Windows (x64) native assets' condition: eq(variables.rid, 'win-x64') inputs: solution: 'Photino.Native.sln' @@ -76,7 +76,7 @@ jobs: # Windows ARM64 - task: NuGetCommand@2 - displayName: 'NuGet package restore for Windows (ARM64) native packages' + displayName: 'NuGet package restore for Windows (ARM64)' condition: eq(variables.rid, 'win-arm64') inputs: command: 'restore' @@ -137,7 +137,7 @@ jobs: # macOS x64 - task: CmdLine@2 - displayName: 'Build macOS (intel) native assets' + displayName: 'Build macOS (x64) native assets' condition: eq(variables.rid, 'osx.12-x64') inputs: workingDirectory: '.' @@ -147,7 +147,7 @@ jobs: mv ./lib/dev/Photino.Native.dylib ./Photino.Native/x64/$(buildConfiguration)/Photino.Native.dylib - task: PublishPipelineArtifact@1 - displayName: 'Publish macOS (intel) libraries to artifacts' + displayName: 'Publish macOS (x64) libraries to artifacts' condition: eq(variables.rid, 'osx.12-x64') inputs: targetPath: './Photino.Native/x64/$(buildConfiguration)/Photino.Native.dylib' diff --git a/azure-pipelines-photino.native-prod.yml b/azure-pipelines-photino.native-prod.yml index feb9551..6db94f5 100644 --- a/azure-pipelines-photino.native-prod.yml +++ b/azure-pipelines-photino.native-prod.yml @@ -11,25 +11,32 @@ variables: buildConfiguration: 'Release' jobs: - - job: 'BuildNative' + - job: 'Build' strategy: matrix: + # Windows windows-intel: rid: 'win-x64' imageName: 'windows-latest' - windows-arm64: - rid: 'win-arm64' - imageName: 'windows-latest' + # No build machine for Windows ARM64 available as of Sep 2022 + # windows-arm64: + # rid: 'win-arm64' + # imageName: 'windows-latest' + + # Linux linux-intel: rid: 'linux-x64' imageName: 'ubuntu-latest' linux-arm64: rid: 'linux-arm64' imageName: 'ubuntu-latest' + + # macOS mac-intel: rid: 'osx.12-x64' imageName: 'macos-12' - #mac-arm64: + # No build machine for macOS ARM64 available as of Sep 2022 + # mac-arm64: # rid: 'osx.12-arm64' # imagename: 'macos-12' @@ -37,255 +44,209 @@ jobs: vmImage: $(imageName) steps: - #Install dependencies - # Windows - - task: NuGetCommand@2 - displayName: 'NuGet package restore for Windows (intel) native packages' + - task: PublishPipelineArtifact@1 + displayName: 'Publish Windows (x64) nuspec to artifacts' condition: eq(variables.rid, 'win-x64') inputs: - command: 'restore' - restoreSolution: 'Photino.Native.sln' - feedsToUse: 'select' + targetPath: './Photino.Native/Photino.Native.nuspec' + artifactName: NuspecArtifact + # Windows x64 - task: NuGetCommand@2 - displayName: 'NuGet package restore for Windows (arm64) native packages' - condition: eq(variables.rid, 'win-arm64') + displayName: 'NuGet package restore for Windows (x64)' + condition: eq(variables.rid, 'win-x64') inputs: command: 'restore' restoreSolution: 'Photino.Native.sln' feedsToUse: 'select' - - # Linux - - task: CmdLine@2 - displayName: 'Install linux (intel) dependencies' - condition: eq(variables.rid, 'linux-x64') - inputs: - script: 'sudo apt-get update && sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev libnotify4 libnotify-dev' - - task: CmdLine@2 - displayName: 'Install linux (arm64) dependencies' - condition: eq(variables.rid, 'linux-arm64') - inputs: - script: 'sudo apt-get update && sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev libnotify4 libnotify-dev' - - # Build - # Windows x64 - task: VSBuild@1 - displayName: 'Build Windows (intel) native assets' + displayName: 'Build Windows (x64) native assets' condition: eq(variables.rid, 'win-x64') inputs: solution: 'Photino.Native.sln' platform: 'x64' + msbuildArchitecture: 'x64' configuration: '$(buildConfiguration)' + - task: PublishPipelineArtifact@1 + displayName: 'Publish Windows (x64) libraries to artifacts' + condition: eq(variables.rid, 'win-x64') + inputs: + targetPath: './Photino.Native/x64/$(buildConfiguration)' + artifactName: WindowsIntelArtifact + # Windows ARM64 + - task: NuGetCommand@2 + displayName: 'NuGet package restore for Windows (ARM64)' + condition: eq(variables.rid, 'win-arm64') + inputs: + command: 'restore' + restoreSolution: 'Photino.Native.sln' + feedsToUse: 'select' + - task: VSBuild@1 - displayName: 'Build Windows (arm64) native assets' + displayName: 'Build Windows (ARM64) native assets' condition: eq(variables.rid, 'win-arm64') inputs: solution: 'Photino.Native.sln' - platform: 'arm64' + platform: 'ARM64' + msbuildArchitecture: 'ARM64' configuration: '$(buildConfiguration)' + - task: PublishPipelineArtifact@1 + displayName: 'Publish Windows (ARM64) libraries to artifacts' + condition: eq(variables.rid, 'win-arm64') + inputs: + targetPath: './Photino.Native/arm64/$(buildConfiguration)' + artifactName: WindowsArm64Artifact + # Linux x64 - task: CmdLine@2 - displayName: 'Create output folder for Linux (intel)' + displayName: 'Build Linux (x64) native assets' condition: eq(variables.rid, 'linux-x64') inputs: - workingDirectory: './Photino.Native' - script: 'mkdir x64; cd x64; mkdir $(buildConfiguration)' + workingDirectory: '.' + script: | + mkdir -p ./Photino.Native/x64/$(buildConfiguration) + make linux-dev + mv ./lib/dev/Photino.Native.so ./Photino.Native/x64/$(buildConfiguration)/Photino.Native.so - - task: CmdLine@2 - displayName: 'Build Linux (intel) native assets' + - task: PublishPipelineArtifact@1 + displayName: 'Publish Linux (x64) libraries to artifacts' condition: eq(variables.rid, 'linux-x64') inputs: - workingDirectory: './Photino.Native' - script: 'gcc -std=c++11 -shared -DOS_LINUX Exports.cpp Photino.Linux.cpp -o x64/$(buildConfiguration)/Photino.Native.so `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0 libnotify` -fPIC' + targetPath: './Photino.Native/x64/$(buildConfiguration)' + artifactName: LinuxIntelArtifact # Linux ARM64 - task: CmdLine@2 - displayName: 'Create output folder for Linux (arm64)' + displayName: 'Build Linux (ARM64) native assets' condition: eq(variables.rid, 'linux-arm64') inputs: - workingDirectory: './Photino.Native' - script: 'mkdir arm64; cd arm64; mkdir $(buildConfiguration)' + workingDirectory: '.' + script: | + mkdir -p ./Photino.Native/arm64/$(buildConfiguration) + make linux-dev + mv ./lib/dev/Photino.Native.so ./Photino.Native/arm64/$(buildConfiguration)/Photino.Native.so - - task: CmdLine@2 - displayName: 'Build Linux (arm64) native assets' + - task: PublishPipelineArtifact@1 + displayName: 'Publish Linux (ARM64) libraries to artifacts' condition: eq(variables.rid, 'linux-arm64') inputs: - workingDirectory: './Photino.Native' - script: 'gcc -std=c++11 -shared -DOS_LINUX Exports.cpp Photino.Linux.cpp -o arm64/$(buildConfiguration)/Photino.Native.so `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0 libnotify` -fPIC' + targetPath: './Photino.Native/arm64/$(buildConfiguration)' + artifactName: LinuxArm64Artifact # macOS x64 - task: CmdLine@2 - displayName: 'Create output folder for macOS (intel)' + displayName: 'Build macOS (x64) native assets' condition: eq(variables.rid, 'osx.12-x64') inputs: workingDirectory: '.' - script: 'mkdir -p ./x64/$(buildConfiguration)' + script: | + mkdir -p ./Photino.Native/x64/$(buildConfiguration) + make mac-dev + mv ./lib/dev/Photino.Native.dylib ./Photino.Native/x64/$(buildConfiguration)/Photino.Native.dylib - - task: CmdLine@2 - displayName: 'Build macOS (intel) native assets' - condition: eq(variables.rid, 'osx.12-x64') - inputs: - workingDirectory: '.' - script: 'make mac-dev && mv ./lib/dev/Photino.Native.dylib ./x64/$(buildConfiguration)/Photino.Native.dylib' - - # macOS ARM64 (no build machine for maxOS M1 available as of Sep 2022) - #- task: CmdLine@2 - # displayName: 'Create output folder for macOS (ARM64)' - # condition: eq(variables.rid, 'osx.12-arm64') - # inputs: - # workingDirectory: '.' - # script: 'mkdir -p ./arm64/$(buildConfiguration)' - - #- task: CmdLine@2 - # displayName: 'Build macOS (ARM64) native assets' - # condition: eq(variables.rid, 'osx.12-arm64') - # inputs: - # workingDirectory: '.' - # script: 'make mac-dev && mv ./lib/dev/Photino.Native.dylib ./arm64/$(buildConfiguration)/Photino.Native.ARM64.dylib' - - # Publish native output to Artifacts - # Windows x64 - task: PublishPipelineArtifact@1 - displayName: 'Publish Photino.Native.dll (Windows x64) to artifacts' - condition: eq(variables.rid, 'win-x64') - inputs: - targetPath: './Photino.Native/x64/$(buildConfiguration)/Photino.Native.dll' - artifactName: 'Photino.Native.dll' - - - task: PublishPipelineArtifact@1 - displayName: 'Publish WebView2Loader.dll (Windows x64) to artifacts' - condition: eq(variables.rid, 'win-x64') - inputs: - targetPath: './Photino.Native/x64/$(buildConfiguration)/WebView2Loader.dll' - artifactName: 'WebView2Loader.dll' - - - task: PublishPipelineArtifact@1 - displayName: 'Publish Photino.Native.nuspec (Windows x64) to artifacts' - condition: eq(variables.rid, 'win-x64') - inputs: - targetPath: './Photino.Native/Photino.Native.nuspec' - artifactName: 'Photino.Native.nuspec' - - # Windows ARM64 - - task: PublishPipelineArtifact@1 - displayName: 'Publish Photino.Native.ARM64.dll (Windows ARM64) to artifacts' - condition: eq(variables.rid, 'win-arm64') - inputs: - targetPath: './Photino.Native/arm64/$(buildConfiguration)/Photino.Native.dll' - artifactName: 'Photino.Native.ARM64.dll' - - - task: PublishPipelineArtifact@1 - displayName: 'Publish WebView2Loader.ARM64.dll (Windows ARM64) to artifacts' - condition: eq(variables.rid, 'win-arm64') - inputs: - targetPath: './Photino.Native/arm64/$(buildConfiguration)/WebView2Loader.dll' - artifactName: 'WebView2Loader.ARM64.dll' - - - task: PublishPipelineArtifact@1 - displayName: 'Publish Photino.Native.nuspec (Windows ARM64) to artifacts' - condition: eq(variables.rid, 'win-arm64') + displayName: 'Publish macOS (x64) libraries to artifacts' + condition: eq(variables.rid, 'osx.12-x64') inputs: - targetPath: './Photino.Native/Photino.Native.nuspec' - artifactName: 'Photino.Native.nuspec' + targetPath: './Photino.Native/x64/$(buildConfiguration)/Photino.Native.dylib' + artifactName: MacOsIntelArtifact - # Linux x64 - - task: PublishPipelineArtifact@1 - displayName: 'Publish Photino.Native.so (Linux x64) to artifacts' - condition: eq(variables.rid, 'linux-x64') + # macOS ARM64 + - task: CmdLine@2 + displayName: 'Build macOS (ARM64) native assets' + condition: eq(variables.rid, 'osx.12-arm64') inputs: - targetPath: './Photino.Native/x64/$(buildConfiguration)/Photino.Native.so' - artifactName: 'Photino.Native.so' + workingDirectory: '.' + script: | + mkdir -p ./Photino.Native/arm64/$(buildConfiguration) + make mac-dev + mv ./lib/dev/Photino.Native.dylib ./Photino.Native/arm64/$(buildConfiguration)/Photino.Native.dylib - # Linux ARM64 - task: PublishPipelineArtifact@1 - displayName: 'Publish Photino.Native.ARM64.so (Linux ARM64) to artifacts' - condition: eq(variables.rid, 'linux-arm64') - inputs: - targetPath: './Photino.Native/arm64/$(buildConfiguration)/Photino.Native.so' - artifactName: 'Photino.Native.ARM64.so' - - # macOS x64 - - task: PublishPipelineArtifact@1 - displayName: 'Publish Photino.Native.dylib (macOS x64) to artifacts' - condition: eq(variables.rid, 'osx.12-x64') + displayName: 'Publish macOS (ARM64) libraries to artifacts' + condition: eq(variables.rid, 'osx.12-arm64') inputs: - targetPath: './x64/$(buildConfiguration)/Photino.Native.dylib' - artifactName: 'Photino.Native.dylib' - - # macOS ARM64 (no build machine for maxOS M1 available as of Sep 2022) - #- task: PublishPipelineArtifact@1 - # displayName: 'Publish Photino.Native.ARM64.dylib (macOS ARM64) to artifacts' - # condition: eq(variables.rid, 'osx.12-arm64') - # inputs: - # targetPath: './arm64/$(buildConfiguration)/Photino.Native.ARM64.dylib' - # artifactName: 'Photino.Native.ARM64.dylib' + targetPath: './Photino.Native/arm64/$(buildConfiguration)/Photino.Native.dylib' + artifactName: MacOsArm64Artifact # 1 instance to download all native files, create NuGet package and publish to Artifacts - job: 'PublishPackage' - dependsOn: 'BuildNative' + dependsOn: 'Build' pool: vmImage: 'windows-latest' - variables: - buildConfiguration: 'Release' - steps: - # Download native files from Artifacts - task: DownloadPipelineArtifact@2 - displayName: 'Download Photino.Native.dll' + displayName: 'Download nuspec file from WindowsIntelArtifact' inputs: - artifact: 'Photino.Native.dll' + artifact: 'NuspecArtifact' + patterns: '**/*.nuspec' + targetPath: '$(Pipeline.Workspace)/' - task: DownloadPipelineArtifact@2 - displayName: 'Download WebView2Loader.dll' + displayName: 'Download WindowsIntelArtifact' inputs: - artifact: 'WebView2Loader.dll' + artifact: WindowsIntelArtifact + patterns: '**/*.dll' + targetPath: '$(Pipeline.Workspace)/x64/' + + # - task: DownloadPipelineArtifact@2 + # displayName: 'Download WindowsArm64Artifact' + # inputs: + # artifact: WindowsArm64Artifact + # patterns: '**/*.dll' + # targetPath: '$(Pipeline.Workspace)/arm64/' - task: DownloadPipelineArtifact@2 - displayName: 'Download Photino.Native.ARM64.dll' + displayName: 'Download LinuxIntelArtifact' inputs: - artifact: 'Photino.Native.ARM64.dll' + artifact: LinuxIntelArtifact + patterns: '**/*.so' + targetPath: '$(Pipeline.Workspace)/x64/' - task: DownloadPipelineArtifact@2 - displayName: 'Download WebView2Loader.ARM64.dll' + displayName: 'Download LinuxArm64Artifact' inputs: - artifact: 'WebView2Loader.ARM64.dll' + artifact: LinuxArm64Artifact + patterns: '**/*.so' + targetPath: '$(Pipeline.Workspace)/arm64/' - task: DownloadPipelineArtifact@2 - displayName: 'Download Photino.Native.nuspec' + displayName: 'Download MacOsIntelArtifact' inputs: - artifact: 'Photino.Native.nuspec' + artifact: MacOsIntelArtifact + patterns: '**/*.dylib' + targetPath: '$(Pipeline.Workspace)/x64/' - - task: DownloadPipelineArtifact@2 - displayName: 'Download Photino.Native.so' + # - task: DownloadPipelineArtifact@2 + # displayName: 'Download MacOsArm64Artifact' + # inputs: + # artifact: MacOsArm64Artifact + # patterns: '**/*.dylib' + # targetPath: '$(Pipeline.Workspace)/arm64/' + + - task: CmdLine@2 + displayName: 'List downloaded files' inputs: - artifact: 'Photino.Native.so' + workingDirectory: '$(Pipeline.Workspace)' + script: 'dir' - - task: DownloadPipelineArtifact@2 - displayName: 'Download Photino.Native.ARM64.so' + - task: CmdLine@2 + displayName: 'List downloaded x64 libraries' inputs: - artifact: 'Photino.Native.ARM64.so' + workingDirectory: '$(Pipeline.Workspace)/x64' + script: 'dir' - - task: DownloadPipelineArtifact@2 - displayName: 'Download Photino.Native.dll' + - task: CmdLine@2 + displayName: 'List downloaded arm64 libraries' inputs: - artifact: 'Photino.Native.dylib' - - #- task: DownloadPipelineArtifact@2 - # displayName: 'Download Photino.Native.ARM64.dylib' - # inputs: - # artifact: 'Photino.Native.ARM64.dylib' - - #- task: CmdLine@2 - # displayName: 'List downloaded files' - # inputs: - # workingDirectory: '$(Pipeline.Workspace)' - # script: 'dir' + workingDirectory: '$(Pipeline.Workspace)/arm64' + script: 'dir' # Create NuGet package - task: CmdLine@2