Skip to content
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/build_cbsinit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Cloudbase-Init build MSI retest

on: [push, pull_request]

jobs:
build:

runs-on: windows-2025
strategy:
max-parallel: 100
matrix:
cbsinit_repo: ['https://github.com/cloudbase/cloudbase-init']
cbsinit_branch: ['master']
python_version: ['3.13_10']
platform: ['x64']

steps:
- uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build msi
shell: cmd
run:
powershell.exe .\BuildAutomation\BuildCloudbaseInitSetup.ps1 ^
-ClonePullInstallerRepo:$false ^
-PythonVersion ${{ matrix.python_version }} ^
-Platform ${{ matrix.platform }} ^
-VCVars "2022" ^
-RelativePythonDirPath:$true ^
-VSRedistDir "''" ^
-CloudbaseInitRepoUrl ${{ matrix.cbsinit_repo }} ^
-CloudbaseInitRepoBranch ${{ matrix.cbsinit_branch }}
- uses: actions/upload-artifact@v4
with:
name: "CloudbaseInit_${{ matrix.platform }}_MSI_${{ matrix.cbsinit_branch }}"
path: 'CloudbaseInitSetup/bin/release/${{ matrix.platform }}/CloudbaseInitSetup.msi'
31 changes: 22 additions & 9 deletions BuildAutomation/BuildCloudbaseInitSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ Param(
[switch]$ClonePullInstallerRepo = $true,
[string]$InstallerDir = $null,
[string]$VSRedistDir = "${ENV:ProgramFiles(x86)}\Common Files\Merge Modules",
[string]$SignTimestampUrl = "http://timestamp.digicert.com?alg=sha256"
[string]$SignTimestampUrl = "http://timestamp.digicert.com?alg=sha256",
[string]$VCVars="2019",
[switch]$RelativePythonDirPath
)

$ErrorActionPreference = "Stop"

$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
$repoRootPath = split-path -parent $scriptPath

. "$scriptPath\BuildUtils.ps1"

$platformVCVarsRequired = "x86_amd64"
Expand All @@ -25,18 +29,23 @@ if ($platform -eq "x86") {
$platformVCVarsRequired = "x86"
}

SetVCVars "2019" $platformVCVarsRequired
SetVCVars $VCVars $platformVCVarsRequired

# Needed for SSH
$ENV:HOME = $ENV:USERPROFILE

$python_dir = "C:\Python_CloudbaseInit"
$basepath = "C:\build\cloudbase-init"

if ($RelativePythonDirPath) {
$python_dir = Join-Path $repoRootPath "CloudbaseInitSetup\Python_CloudbaseInit"
$basepath = Join-path $scriptPath "build\cloudbase-init"
}

$ENV:PATH = "$python_dir\;$python_dir\scripts;$ENV:PATH"
$ENV:PATH += ";$ENV:ProgramFiles (x86)\Git\bin\"
$ENV:PATH += ";$ENV:ProgramFiles\7-zip\"

$basepath = "C:\build\cloudbase-init"
CheckDir $basepath

pushd .
Expand Down Expand Up @@ -164,13 +173,17 @@ try

$installer_sources_dir = join-path $cloudbaseInitInstallerDir "CloudbaseInitSetup"

if($platform -eq "x64")
{
copy "${VSRedistDir}\Microsoft_VC140_CRT_x64.msm" $installer_sources_dir
}
else

if ($VSRedistDir)
{
copy "${VSRedistDir}\Microsoft_VC140_CRT_x86.msm" $installer_sources_dir
if($platform -eq "x64")
{
copy "${VSRedistDir}\Microsoft_VC140_CRT_x64.msm" $installer_sources_dir
}
else
{
copy "${VSRedistDir}\Microsoft_VC140_CRT_x86.msm" $installer_sources_dir
}
}

cd $cloudbaseInitInstallerDir
Expand Down
13 changes: 0 additions & 13 deletions CloudbaseInitSetup.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "CloudbaseInitSetup", "CloudbaseInitSetup\CloudbaseInitSetup.wixproj", "{72504EA8-DE95-42DA-91EA-4359BA85699E}"
ProjectSection(ProjectDependencies) = postProject
{03E4CD9D-2149-424A-9092-9162DE22F105} = {03E4CD9D-2149-424A-9092-9162DE22F105}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildAutomation", "BuildAutomation", "{2F8164AD-5423-46D8-BC71-554873129841}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -32,16 +29,6 @@ Global
{72504EA8-DE95-42DA-91EA-4359BA85699E}.Release|x64.Build.0 = Release|x64
{72504EA8-DE95-42DA-91EA-4359BA85699E}.Release|x86.ActiveCfg = Release|x86
{72504EA8-DE95-42DA-91EA-4359BA85699E}.Release|x86.Build.0 = Release|x86
{03E4CD9D-2149-424A-9092-9162DE22F105}.Debug|x64.ActiveCfg = Debug|x64
{03E4CD9D-2149-424A-9092-9162DE22F105}.Debug|x64.Build.0 = Debug|x64
{03E4CD9D-2149-424A-9092-9162DE22F105}.Debug|x86.ActiveCfg = Debug|Win32
{03E4CD9D-2149-424A-9092-9162DE22F105}.Debug|x86.Build.0 = Debug|Win32
{03E4CD9D-2149-424A-9092-9162DE22F105}.Debug|x86.Deploy.0 = Debug|Win32
{03E4CD9D-2149-424A-9092-9162DE22F105}.Release|x64.ActiveCfg = Release|x64
{03E4CD9D-2149-424A-9092-9162DE22F105}.Release|x64.Build.0 = Release|x64
{03E4CD9D-2149-424A-9092-9162DE22F105}.Release|x86.ActiveCfg = Release|Win32
{03E4CD9D-2149-424A-9092-9162DE22F105}.Release|x86.Build.0 = Release|Win32
{03E4CD9D-2149-424A-9092-9162DE22F105}.Release|x86.Deploy.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file added CloudbaseInitSetup/Binaries/x64/UtilsActions.dll
Binary file not shown.
Binary file added CloudbaseInitSetup/Binaries/x86/UtilsActions.dll
Binary file not shown.
11 changes: 5 additions & 6 deletions CloudbaseInitSetup/CloudbaseInitSetup.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\$(platform)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>PythonSourcePath=C:\Python_CloudbaseInit;CarbonSourcePath=Carbon;Version=1.0.0.0;VersionStr=1.0.0.0</DefineConstants>
<DefineConstants>PythonSourcePath=Python_CloudbaseInit;CarbonSourcePath=Carbon;Version=1.0.0.0;VersionStr=1.0.0.0</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>Debug</DefineConstants>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DefineConstants>PythonSourcePath=C:\Python_CloudbaseInit;CarbonSourcePath=Carbon;Version=1.0.0.0;VersionStr=1.0.0.0</DefineConstants>
<DefineConstants>PythonSourcePath=Python_CloudbaseInit;CarbonSourcePath=Carbon;Version=1.0.0.0;VersionStr=1.0.0.0</DefineConstants>
<OutputPath>bin\$(Configuration)\$(platform)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
Expand Down Expand Up @@ -309,10 +309,9 @@
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<Target Name="BeforeBuild">
<HeatDirectory DirectoryRefId="INSTALLDIR" OutputFile="Python_tmp.wxs" Directory="C:\Python_CloudbaseInit" ComponentGroupName="PythonComponentGroup" ToolPath="$(WixToolPath)" PreprocessorVariable="var.PythonSourcePath" GenerateGuidsNow="true" SuppressCom="true" SuppressRegistry="true" KeepEmptyDirectories="true" />
<HeatDirectory DirectoryRefId="INSTALLDIR" OutputFile="Python_tmp.wxs" Directory="Python_CloudbaseInit" ComponentGroupName="PythonComponentGroup" ToolPath="$(WixToolPath)" PreprocessorVariable="var.PythonSourcePath" GenerateGuidsNow="true" SuppressCom="true" SuppressRegistry="true" KeepEmptyDirectories="true" RunAsSeparateProcess="true" />
<XslTransformation XmlInputPaths="Python_tmp.wxs" XslInputPath="Python.xslt" OutputPaths="Python.wxs" Parameters="&lt;Parameter Name='platform' Value='$(Platform)'/&gt;" />
<HeatDirectory DirectoryRefId="PowershellModules" OutputFile="Carbon.wxs" Directory="Carbon" ComponentGroupName="CarbonComponentGroup" ToolPath="$(WixToolPath)" PreprocessorVariable="var.CarbonSourcePath" GenerateGuidsNow="true" SuppressCom="true" SuppressRegistry="true" KeepEmptyDirectories="true" Transforms="Carbon.xslt">
</HeatDirectory>
<HeatDirectory DirectoryRefId="PowershellModules" OutputFile="Carbon.wxs" Directory="Carbon" ComponentGroupName="CarbonComponentGroup" ToolPath="$(WixToolPath)" PreprocessorVariable="var.CarbonSourcePath" GenerateGuidsNow="true" SuppressCom="true" SuppressRegistry="true" KeepEmptyDirectories="true" Transforms="Carbon.xslt" RunAsSeparateProcess="true" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Expand All @@ -322,4 +321,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Binary file added CloudbaseInitSetup/Microsoft_VC140_CRT_x64.msm
Binary file not shown.
Binary file added CloudbaseInitSetup/Microsoft_VC140_CRT_x86.msm
Binary file not shown.