parallelize msi and exe creation

Contributes to CURA-8415
This commit is contained in:
Jelle Spijker 2023-08-19 01:03:08 +02:00
parent 67caa185db
commit f2c68fe2ce
No known key found for this signature in database
GPG key ID: 034D1C0527888B65

View file

@ -84,6 +84,9 @@ jobs:
cura-installer-create:
runs-on: ${{ inputs.operating_system }}
outputs:
INSTALLER_FILENAME: ${{ steps.filename.outputs.INSTALLER_FILENAME }}
steps:
- name: Checkout
uses: actions/checkout@v3
@ -110,16 +113,6 @@ jobs:
- name: Create the default Conan profile
run: conan profile new default --detect --force
- name: Create PFX certificate from BASE64_PFX_CONTENT secret
id: create-pfx
env:
PFX_CONTENT: ${{ secrets.WIN_CERT_INSTALLER_CER }}
run: |
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx";
$encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT);
Set-Content $pfxPath -Value $encodedBytes -AsByteStream;
echo "PFX_PATH=$pfxPath" >> $env:GITHUB_OUTPUT;
- name: Get Conan configuration
run: conan config install https://github.com/Ultimaker/conan-config.git
@ -206,49 +199,95 @@ jobs:
for package in pkg_resources.working_set:
f.writelines(f"`{package.key}/{package.version}`\n")
- name: upload the dist folder
uses: actions/upload-artifact@v3
with:
name: dist
path: |
dist/
retention-days: 5
cura-installer-create-exe:
needs: [ cura-installer-create ]
runs-on: ${{ inputs.operating_system }}
steps:
- name: Download the dist
uses: actions/download-artifact@v3
with:
name: dist
- name: Create PFX certificate from BASE64_PFX_CONTENT secret
id: create-pfx
env:
PFX_CONTENT: ${{ secrets.WIN_CERT_INSTALLER_CER }}
run: |
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx";
$encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT);
Set-Content $pfxPath -Value $encodedBytes -AsByteStream;
echo "PFX_PATH=$pfxPath" >> $env:GITHUB_OUTPUT;
- name: Create the Windows exe installer (Powershell)
run: |
python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "${{ steps.filename.outputs.INSTALLER_FILENAME }}.exe"
working-directory: dist
- name: Create the Windows msi installer (Powershell)
run: |
python ..\cura_inst\packaging\msi\create_windows_msi.py ..\cura_inst .\UltiMaker-Cura "${{ steps.filename.outputs.INSTALLER_FILENAME }}.msi" "$Env:CURA_APP_NAME"
python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.exe"
working-directory: dist
- name: Sign the Windows exe installer (Powershell)
env:
PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }}
run: |
& "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{ steps.filename.outputs.INSTALLER_FILENAME }}.exe"
& "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.exe"
working-directory: dist
- name: Upload the exe
uses: actions/upload-artifact@v3
with:
name: ${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}-exe
path: |
dist/${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.exe
retention-days: 5
cura-installer-create-msi:
needs: [ cura-installer-create ]
runs-on: ${{ inputs.operating_system }}
steps:
- name: Download the dist
uses: actions/download-artifact@v3
with:
name: dist
- name: Create PFX certificate from BASE64_PFX_CONTENT secret
id: create-pfx
env:
PFX_CONTENT: ${{ secrets.WIN_CERT_INSTALLER_CER }}
run: |
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx";
$encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT);
Set-Content $pfxPath -Value $encodedBytes -AsByteStream;
echo "PFX_PATH=$pfxPath" >> $env:GITHUB_OUTPUT;
- name: Create the Windows msi installer (Powershell)
run: |
python ..\cura_inst\packaging\msi\create_windows_msi.py ..\cura_inst .\UltiMaker-Cura "${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.msi" "$Env:CURA_APP_NAME"
working-directory: dist
- name: Sign the Windows msi installer (Powershell)
env:
PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }}
run: |
& "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{ steps.filename.outputs.INSTALLER_FILENAME }}.msi"
& "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.msi"
working-directory: dist
- name: Upload the exe
uses: actions/upload-artifact@v3
with:
name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-exe
path: |
dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.exe
retention-days: 5
- name: Upload the msi
uses: actions/upload-artifact@v3
with:
name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-msi
name: ${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}-msi
path: |
dist/${{ steps.filename.outputs.INSTALLER_FILENAME }}.msi
dist/${{ needs.cura-installer-create.outputs.INSTALLER_FILENAME }}.msi
retention-days: 5
notify-export:
if: ${{ always() }}
needs: [ cura-installer-create ]
needs: [ cura-installer-create-exe, cura-installer-create-msi ]
uses: ultimaker/cura/.github/workflows/notify.yml@main
with: