Skip to content

Commit b9acacd

Browse files
Update build-and-sign-sequential.yml
1 parent 0cccd7a commit b9acacd

File tree

1 file changed

+57
-54
lines changed

1 file changed

+57
-54
lines changed

.github/workflows/build-and-sign-sequential.yml

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,9 @@ jobs:
539539
token: ${{ secrets.GITHUB_TOKEN }}
540540
continue-on-error: true
541541

542-
# Build installer using signed components
542+
# Build installer using existing artifacts in repo
543543
- name: Build Virtual Driver Installer
544-
if: steps.signpath_unified_request.outcome == 'success' && github.event.inputs.build_installer != 'false'
544+
if: github.event.inputs.build_installer != 'false'
545545
run: |
546546
Write-Output "Building Virtual Driver Installer..."
547547
@@ -553,48 +553,47 @@ jobs:
553553
554554
Push-Location $installerPath
555555
556-
# Copy signed artifacts to installer input directory
557-
$signedArtifactsPath = "${{ vars.SIGNPATH_OUTPUT_DIR }}"
558-
if (Test-Path $signedArtifactsPath) {
559-
Write-Output "Copying signed artifacts to installer input..."
560-
561-
# Create SignedArtifacts directory structure expected by build script
562-
New-Item -ItemType Directory -Path "SignedArtifacts" -Force
563-
Copy-Item "$signedArtifactsPath\*" -Destination "SignedArtifacts\" -Recurse -Force
556+
# Use existing artifacts from the repo (as mentioned by user)
557+
Write-Output "Using existing artifacts from installer repository..."
558+
559+
# Install Inno Setup
560+
Write-Output "Installing Inno Setup..."
561+
choco install innosetup -y
562+
if ($LASTEXITCODE -ne 0) {
563+
Write-Output "Failed to install Inno Setup"
564+
exit 1
565+
}
566+
567+
# Update version in Setup.iss
568+
if (Test-Path "Setup.iss") {
569+
Write-Output "Updating version in Setup.iss..."
570+
$releaseTag = "${{ env.RELEASE_TAG }}"
571+
if ([string]::IsNullOrEmpty($releaseTag)) {
572+
$releaseTag = (Get-Date).ToString('yy.MM.dd')
573+
}
564574
565-
Write-Output "Contents of SignedArtifacts directory:"
566-
Get-ChildItem "SignedArtifacts" -Recurse | ForEach-Object { Write-Output " - $($_.FullName)" }
575+
# Read and update Setup.iss
576+
$setupContent = Get-Content "Setup.iss"
577+
$setupContent = $setupContent -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$releaseTag`""
578+
$setupContent = $setupContent -replace 'OutputBaseFilename=.*', "OutputBaseFilename=Virtual-Driver-Control-v$releaseTag-setup-x64"
579+
$setupContent | Set-Content "Setup.iss"
567580
568-
# Run the installer build script
569-
Write-Output "Running installer build script..."
570-
if (Test-Path "build-installer.ps1") {
571-
.\build-installer.ps1
572-
573-
# Install Inno Setup if not available
574-
if (-not (Get-Command "iscc" -ErrorAction SilentlyContinue)) {
575-
Write-Output "Installing Inno Setup..."
576-
choco install innosetup -y
577-
if ($LASTEXITCODE -ne 0) {
578-
Write-Output "Failed to install Inno Setup"
579-
exit 1
580-
}
581-
}
582-
583-
# Compile the installer using Inno Setup
584-
Write-Output "Compiling installer with Inno Setup..."
585-
$issFile = "Setup.iss"
586-
if (Test-Path $issFile) {
587-
iscc $issFile
588-
if ($LASTEXITCODE -eq 0) {
589-
Write-Output "✅ Inno Setup compilation completed"
590-
} else {
591-
Write-Output "❌ Inno Setup compilation failed with exit code: $LASTEXITCODE"
592-
exit 1
593-
}
594-
} else {
595-
Write-Output "❌ Setup.iss not found"
596-
exit 1
597-
}
581+
Write-Output "Updated version to: $releaseTag"
582+
}
583+
584+
# Run the installer build script if it exists
585+
if (Test-Path "build-installer.ps1") {
586+
Write-Output "Running installer preparation script..."
587+
.\build-installer.ps1
588+
}
589+
590+
# Compile the installer using Inno Setup
591+
Write-Output "Compiling installer with Inno Setup..."
592+
$issFile = "Setup.iss"
593+
if (Test-Path $issFile) {
594+
iscc $issFile
595+
if ($LASTEXITCODE -eq 0) {
596+
Write-Output "✅ Inno Setup compilation completed"
598597
599598
# Check if installer was built successfully
600599
if (Test-Path "output\*.exe") {
@@ -603,36 +602,37 @@ jobs:
603602
Write-Output "Built installer: $($_.Name) ($(($_.Length / 1MB).ToString('F2')) MB)"
604603
}
605604
606-
# Get the actual installer file path for upload
605+
# Get the actual installer file for upload
607606
$installerFile = Get-ChildItem "output\*.exe" | Select-Object -First 1
608607
Write-Output "INSTALLER_NAME=$($installerFile.Name)" >> $env:GITHUB_ENV
608+
Write-Output "INSTALLER_SUCCESS=true" >> $env:GITHUB_ENV
609609
} else {
610610
Write-Output "❌ No installer executable found in output directory"
611611
Get-ChildItem "output" -ErrorAction SilentlyContinue | ForEach-Object {
612612
Write-Output "Found in output: $($_.Name)"
613613
}
614-
exit 1
614+
Write-Output "INSTALLER_SUCCESS=false" >> $env:GITHUB_ENV
615615
}
616616
} else {
617-
Write-Output "❌ build-installer.ps1 not found"
618-
exit 1
617+
Write-Output "❌ Inno Setup compilation failed with exit code: $LASTEXITCODE"
618+
Write-Output "INSTALLER_SUCCESS=false" >> $env:GITHUB_ENV
619619
}
620620
} else {
621-
Write-Output "❌ Signed artifacts not found at: $signedArtifactsPath"
622-
exit 1
621+
Write-Output "❌ Setup.iss not found"
622+
Write-Output "INSTALLER_SUCCESS=false" >> $env:GITHUB_ENV
623623
}
624624
625625
Pop-Location
626-
continue-on-error: true
627626
628627
# Upload built installer
629628
- name: Upload Virtual Driver Installer
630-
if: env.INSTALLER_NAME != ''
629+
if: env.INSTALLER_SUCCESS == 'true'
631630
uses: actions/upload-artifact@v4
632631
with:
633632
name: Virtual-Driver-Installer-${{ env.BUILD_CONFIGURATION }}-${{ env.RELEASE_TAG }}
634-
path: installer-repo/output/${{ env.INSTALLER_NAME }}
635-
continue-on-error: true
633+
path: installer-repo/output/
634+
retention-days: 30
635+
continue-on-error: false
636636

637637
# Build Summary
638638
- name: Build and SignPath Summary
@@ -675,10 +675,13 @@ jobs:
675675
}
676676
Write-Output ""
677677
Write-Output "Installer Build Status:"
678-
if ('${{ env.INSTALLER_NAME }}' -ne '') {
678+
if ('${{ env.INSTALLER_SUCCESS }}' -eq 'true') {
679679
Write-Output "✅ Virtual Driver Installer built successfully: ${{ env.INSTALLER_NAME }}"
680+
Write-Output " Uploaded to artifacts: Virtual-Driver-Installer-${{ env.BUILD_CONFIGURATION }}-${{ env.RELEASE_TAG }}"
681+
} elseif ('${{ github.event.inputs.build_installer }}' -eq 'false') {
682+
Write-Output "⏭️ Installer build skipped (disabled via input)"
680683
} else {
681-
Write-Output "❌ Installer build failed or skipped"
684+
Write-Output "❌ Installer build failed or was not attempted"
682685
}
683686
Write-Output ""
684687
Write-Output "⚠️ Note: ARM64 VAD skipped due to Windows Driver Kit cross-compilation issues"

0 commit comments

Comments
 (0)