ci/cd: use different build paths for each runtime (#13863)

This commit is contained in:
Diego Heras 2023-01-07 15:55:03 +01:00 committed by GitHub
parent b6611b1bb5
commit c95d268a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 36 deletions

View File

@ -73,27 +73,21 @@ stages:
artifactName: Jackett.Binaries.LinuxARM64.tar.gz artifactName: Jackett.Binaries.LinuxARM64.tar.gz
LinuxMuslAMDx64: LinuxMuslAMDx64:
buildDescription: Linux musl AMD x64 buildDescription: Linux musl AMD x64
# We build musl binaries using a different ubuntu image on purpose. The stages using the same image could imageName: ubuntu-22.04
# run in the same virtual machine sharing the file system and causing this error:
# error MSB4018: System.IO.IOException: The process cannot access the file '/home/vsts/work/1/s/src/DateTimeRoutines/bin/Release/netstandard2.0/DateTimeRoutines.deps.json'
# because it is being used by another process. [/home/vsts/work/1/s/src/DateTimeRoutines/DateTimeRoutines.csproj]
imageName: ubuntu-20.04
framework: $(netCoreFramework) framework: $(netCoreFramework)
runtime: linux-musl-x64 runtime: linux-musl-x64
archiveType: tar archiveType: tar
artifactName: Jackett.Binaries.LinuxMuslAMDx64.tar.gz artifactName: Jackett.Binaries.LinuxMuslAMDx64.tar.gz
LinuxMuslARM32: LinuxMuslARM32:
buildDescription: Linux musl ARM32 buildDescription: Linux musl ARM32
# see comment in LinuxMuslAMDx64 imageName: ubuntu-22.04
imageName: ubuntu-20.04
framework: $(netCoreFramework) framework: $(netCoreFramework)
runtime: linux-musl-arm runtime: linux-musl-arm
archiveType: tar archiveType: tar
artifactName: Jackett.Binaries.LinuxMuslARM32.tar.gz artifactName: Jackett.Binaries.LinuxMuslARM32.tar.gz
LinuxMuslARM64: LinuxMuslARM64:
buildDescription: Linux musl ARM64 buildDescription: Linux musl ARM64
# see comment in LinuxMuslAMDx64 imageName: ubuntu-22.04
imageName: ubuntu-20.04
framework: $(netCoreFramework) framework: $(netCoreFramework)
runtime: linux-musl-arm64 runtime: linux-musl-arm64
archiveType: tar archiveType: tar
@ -111,6 +105,7 @@ stages:
steps: steps:
- checkout: self - checkout: self
clean: false clean: false
path: '$(framework)-$(runtime)'
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Install .NET Core SDK displayName: Install .NET Core SDK
@ -126,7 +121,7 @@ stages:
projects: 'src/Jackett.Server/Jackett.Server.csproj' projects: 'src/Jackett.Server/Jackett.Server.csproj'
publishWebProjects: false publishWebProjects: false
zipAfterPublish: false zipAfterPublish: false
arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework) --self-contained --output $(Build.BinariesDirectory) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)' arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework) --self-contained --output $(Build.BinariesDirectory)/$(framework)-$(runtime) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)'
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: Build Jackett Updater displayName: Build Jackett Updater
@ -135,7 +130,7 @@ stages:
projects: 'src/Jackett.Updater/Jackett.Updater.csproj' projects: 'src/Jackett.Updater/Jackett.Updater.csproj'
publishWebProjects: false publishWebProjects: false
zipAfterPublish: false zipAfterPublish: false
arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework) --self-contained --output $(Build.BinariesDirectory) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)' arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework) --self-contained --output $(Build.BinariesDirectory)/$(framework)-$(runtime) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)'
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: Build Jackett Tray (Windows only) displayName: Build Jackett Tray (Windows only)
@ -145,7 +140,7 @@ stages:
projects: 'src/Jackett.Tray/Jackett.Tray.csproj' projects: 'src/Jackett.Tray/Jackett.Tray.csproj'
publishWebProjects: false publishWebProjects: false
zipAfterPublish: false zipAfterPublish: false
arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)-windows --self-contained --output $(Build.BinariesDirectory) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)' arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)-windows --self-contained --output $(Build.BinariesDirectory)/$(framework)-$(runtime) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)'
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: Build Jackett Service (Windows only) displayName: Build Jackett Service (Windows only)
@ -155,50 +150,50 @@ stages:
projects: 'src/Jackett.Service/Jackett.Service.csproj' projects: 'src/Jackett.Service/Jackett.Service.csproj'
publishWebProjects: false publishWebProjects: false
zipAfterPublish: false zipAfterPublish: false
arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)-windows --self-contained --output $(Build.BinariesDirectory) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)' arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)-windows --self-contained --output $(Build.BinariesDirectory)/$(framework)-$(runtime) /p:AssemblyVersion=$(jackettVersion) /p:FileVersion=$(jackettVersion) /p:InformationalVersion=$(jackettVersion) /p:Version=$(jackettVersion)'
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy Jackett Server displayName: Copy Jackett Server
inputs: inputs:
SourceFolder: $(Build.BinariesDirectory)/Jackett.Server SourceFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett.Server
contents: '**' contents: '**'
targetFolder: $(Build.BinariesDirectory)/Jackett targetFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy Jackett Updater displayName: Copy Jackett Updater
inputs: inputs:
SourceFolder: $(Build.BinariesDirectory)/Jackett.Updater SourceFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett.Updater
contents: JackettUpdater* contents: JackettUpdater*
targetFolder: $(Build.BinariesDirectory)/Jackett targetFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy Jackett Tray (Windows only) displayName: Copy Jackett Tray (Windows only)
condition: and(succeeded(), startsWith(variables['runtime'], 'win')) condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
inputs: inputs:
SourceFolder: $(Build.BinariesDirectory)/Jackett.Tray SourceFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett.Tray
contents: | contents: |
System.Drawing.dll System.Drawing.dll
System.Security.Cryptography.ProtectedData.dll System.Security.Cryptography.ProtectedData.dll
WindowsBase.dll WindowsBase.dll
targetFolder: $(Build.BinariesDirectory)/Jackett targetFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
overWrite: true overWrite: true
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy Jackett Tray Part 2 (Windows only) displayName: Copy Jackett Tray Part 2 (Windows only)
condition: and(succeeded(), startsWith(variables['runtime'], 'win')) condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
inputs: inputs:
SourceFolder: $(Build.BinariesDirectory)/Jackett.Tray SourceFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett.Tray
contents: '*' contents: '*'
targetFolder: $(Build.BinariesDirectory)/Jackett targetFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
overWrite: false overWrite: false
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy Jackett Service (Windows only) displayName: Copy Jackett Service (Windows only)
condition: and(succeeded(), startsWith(variables['runtime'], 'win')) condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
inputs: inputs:
SourceFolder: $(Build.BinariesDirectory)/Jackett.Service SourceFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett.Service
contents: JackettService* contents: JackettService*
targetFolder: $(Build.BinariesDirectory)/Jackett targetFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy Windows Specific Scripts (Windows only) displayName: Copy Windows Specific Scripts (Windows only)
@ -206,7 +201,7 @@ stages:
inputs: inputs:
SourceFolder: $(Build.SourcesDirectory) SourceFolder: $(Build.SourcesDirectory)
contents: jackett_launcher.bat contents: jackett_launcher.bat
targetFolder: $(Build.BinariesDirectory)/Jackett targetFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy Mono Specific Scripts displayName: Copy Mono Specific Scripts
@ -216,7 +211,7 @@ stages:
contents: | contents: |
install_service_systemd_mono.sh install_service_systemd_mono.sh
Upstart.config Upstart.config
targetFolder: $(Build.BinariesDirectory)/Jackett targetFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy macOS Specific Scripts displayName: Copy macOS Specific Scripts
@ -226,7 +221,7 @@ stages:
contents: | contents: |
install_service_macos install_service_macos
uninstall_jackett_macos uninstall_jackett_macos
targetFolder: $(Build.BinariesDirectory)/Jackett targetFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Copy Linux Specific Scripts displayName: Copy Linux Specific Scripts
@ -236,7 +231,7 @@ stages:
contents: | contents: |
install_service_systemd.sh install_service_systemd.sh
jackett_launcher.sh jackett_launcher.sh
targetFolder: $(Build.BinariesDirectory)/Jackett targetFolder: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
# There is an issue with Mono 5.8 (fixed in Mono 5.12) where its expecting to use its own patched version of # There is an issue with Mono 5.8 (fixed in Mono 5.12) where its expecting to use its own patched version of
# System.Net.Http.dll, instead of the version supplied in folder # System.Net.Http.dll, instead of the version supplied in folder
@ -250,26 +245,26 @@ stages:
displayName: Patch Mono Build (Mono only) displayName: Patch Mono Build (Mono only)
condition: and(succeeded(), startsWith(variables['buildDescription'], 'Mono')) condition: and(succeeded(), startsWith(variables['buildDescription'], 'Mono'))
inputs: inputs:
workingDirectory: $(Build.BinariesDirectory)/Jackett workingDirectory: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
targetType: inline targetType: inline
script: | script: |
$file = '$(Build.BinariesDirectory)/Jackett/JackettConsole.exe.config' $file = '$(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett/JackettConsole.exe.config'
$xml = [xml] (Get-Content $file) $xml = [xml] (Get-Content $file)
$newVersion = $xml.SelectSingleNode("configuration/runtime/*[name()='assemblyBinding']/*[name()='dependentAssembly']/*[name()='assemblyIdentity'][@name='System.Net.Http']/../*[name()='bindingRedirect']/@newVersion") $newVersion = $xml.SelectSingleNode("configuration/runtime/*[name()='assemblyBinding']/*[name()='dependentAssembly']/*[name()='assemblyIdentity'][@name='System.Net.Http']/../*[name()='bindingRedirect']/@newVersion")
$newVersion.Value = '4.0.0.0' $newVersion.Value = '4.0.0.0'
$xml.Save($file) $xml.Save($file)
Remove-Item '$(Build.BinariesDirectory)/Jackett/System.Net.Http.dll' Remove-Item '$(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett/System.Net.Http.dll'
Remove-Item '$(Build.BinariesDirectory)/Jackett/System.Runtime.InteropServices.RuntimeInformation.dll' Remove-Item '$(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett/System.Runtime.InteropServices.RuntimeInformation.dll'
- task: Bash@3 - task: Bash@3
displayName: Set Folder and File Permissions (Mono, Linux and macOS) displayName: Set Folder and File Permissions (Mono, Linux and macOS)
condition: and(succeeded(), not(startsWith(variables['runtime'], 'win'))) condition: and(succeeded(), not(startsWith(variables['runtime'], 'win')))
inputs: inputs:
workingDirectory: $(Build.BinariesDirectory)/Jackett workingDirectory: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
targetType: inline targetType: inline
script: | script: |
chmod 755 $(find "$(Build.BinariesDirectory)"/Jackett -type d) chmod 755 $(find "$(Build.BinariesDirectory)/$(framework)-$(runtime)"/Jackett -type d)
chmod 644 $(find "$(Build.BinariesDirectory)"/Jackett -type f) chmod 644 $(find "$(Build.BinariesDirectory)/$(framework)-$(runtime)"/Jackett -type f)
chmod 755 jackett chmod 755 jackett
chmod 755 JackettUpdater chmod 755 JackettUpdater
if [ -f install_service_systemd_mono.sh ]; then chmod 755 install_service_systemd_mono.sh; fi if [ -f install_service_systemd_mono.sh ]; then chmod 755 install_service_systemd_mono.sh; fi
@ -281,7 +276,7 @@ stages:
- task: ArchiveFiles@2 - task: ArchiveFiles@2
displayName: Compress Binaries displayName: Compress Binaries
inputs: inputs:
rootFolderOrFile: $(Build.BinariesDirectory)/Jackett rootFolderOrFile: $(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
includeRootFolder: true includeRootFolder: true
archiveType: '$(archiveType)' archiveType: '$(archiveType)'
tarCompression: gz tarCompression: gz
@ -295,7 +290,7 @@ stages:
iscc.exe $(Build.SourcesDirectory)/Installer.iss iscc.exe $(Build.SourcesDirectory)/Installer.iss
/O"$(Build.ArtifactStagingDirectory)" /O"$(Build.ArtifactStagingDirectory)"
/DMyAppVersion=$(jackettVersion) /DMyAppVersion=$(jackettVersion)
/DMySourceFolder=$(Build.BinariesDirectory)/Jackett /DMySourceFolder=$(Build.BinariesDirectory)/$(framework)-$(runtime)/Jackett
/DMyOutputFilename=Jackett.Installer.Windows /DMyOutputFilename=Jackett.Installer.Windows
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
@ -315,6 +310,7 @@ stages:
steps: steps:
- checkout: self - checkout: self
clean: false clean: false
path: lint-dotnet
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Install .NET Core SDK displayName: Install .NET Core SDK
@ -349,6 +345,7 @@ stages:
steps: steps:
- checkout: self - checkout: self
clean: false clean: false
path: lint-yaml
- task: UsePythonVersion@0 - task: UsePythonVersion@0
displayName: Install Python displayName: Install Python
@ -370,6 +367,7 @@ stages:
steps: steps:
- checkout: self - checkout: self
clean: false clean: false
path: validate-yaml
- task: Bash@3 - task: Bash@3
displayName: Validate YAML Schema displayName: Validate YAML Schema
@ -428,6 +426,7 @@ stages:
steps: steps:
- checkout: self - checkout: self
clean: false clean: false
path: '$(framework)-$(runtime)'
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Install .NET Core SDK displayName: Install .NET Core SDK
@ -526,6 +525,7 @@ stages:
steps: steps:
- checkout: self - checkout: self
clean: false clean: false
path: '$(framework)-$(runtime)'
- task: DownloadBuildArtifacts@0 - task: DownloadBuildArtifacts@0
displayName: Download artifacts for integration tests displayName: Download artifacts for integration tests
@ -604,6 +604,7 @@ stages:
steps: steps:
- checkout: self - checkout: self
clean: false clean: false
path: publish
- task: DownloadBuildArtifacts@0 - task: DownloadBuildArtifacts@0
displayName: Download Artifacts for Publish displayName: Download Artifacts for Publish