BuildWin32.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. name: Build PicView Win32
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. pull_request:
  7. branches:
  8. - dev
  9. workflow_dispatch:
  10. jobs:
  11. build:
  12. runs-on: windows-latest
  13. steps:
  14. # Step 1: Checkout the code
  15. - name: Checkout repository
  16. uses: actions/checkout@v4
  17. # Step 2: Setup .NET 10 SDK
  18. - name: Setup .NET 10 SDK
  19. uses: actions/setup-dotnet@v5
  20. with:
  21. dotnet-version: '10.x'
  22. # Step 3: Get version from Directory.Build.props using PowerShell
  23. - name: Get version from Directory.Build.props
  24. id: get-version
  25. run: pwsh -File "${{ github.workspace }}/Build/Get-VersionInfo.ps1"
  26. # Step 4 (x64): Publish x64 version
  27. - name: Publish x64 version
  28. run: |
  29. pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "x64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64"
  30. shell: pwsh
  31. # Step 5 (x64): Upload the x64 zip file as an artifact
  32. - name: Upload the x64 artifact
  33. uses: actions/upload-artifact@v4
  34. with:
  35. name: PicView-v${{steps.get-version.outputs.version}}-win-x64
  36. path: ${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-win-x64/
  37. retention-days: 14
  38. # Step 5.5 (x64): Remove .pdb files from x64 build before installer
  39. - name: Remove .pdb files from x64 build for installer
  40. run: |
  41. Remove-Item -Path "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64\*.pdb" -Force -ErrorAction SilentlyContinue
  42. shell: pwsh
  43. # Step 6 (x64): Install Inno Setup
  44. - name: Install Inno Setup
  45. run: |
  46. choco install innosetup -y
  47. # Step 7 (x64): Compile .ISS to .EXE Installer for x64
  48. - name: Compile .ISS to .EXE Installer (x64)
  49. run: |
  50. New-Item -Path "${{ github.workspace }}\Build\install" -ItemType Directory -Force
  51. & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' `
  52. /O+ `
  53. /DMyAppVersion="${{steps.get-version.outputs.clean-version}}" `
  54. /DMyAppOutputDir="${{ github.workspace }}\Build\install" `
  55. /DMyFileSource="${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64" `
  56. /DMyAppOutputName="PicView-v${{steps.get-version.outputs.version}}-win-x64" `
  57. /DLicenseFile="${{ github.workspace }}\src\PicView.Core\Licenses\LICENSE.txt" `
  58. /DAppIcon="${{ github.workspace }}\src\PicView.Avalonia.Win32\icon.ico" `
  59. /DVersionInfoVersion="${{steps.get-version.outputs.clean-version}}" `
  60. "${{ github.workspace }}\Build\install.iss"
  61. shell: pwsh
  62. # Step 8 (x64): Upload Inno Setup Installer for x64 as an artifact
  63. - name: Upload Inno Setup Installer (x64)
  64. uses: actions/upload-artifact@v4
  65. with:
  66. name: PicView-${{steps.get-version.outputs.version}}-installer-x64
  67. path: ${{ github.workspace }}\Build\install\PicView-v${{steps.get-version.outputs.version}}-win-x64.exe
  68. retention-days: 14
  69. # Step 9 (arm64): Publish arm64 version
  70. - name: Publish arm64 version
  71. run: |
  72. pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "arm64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64"
  73. shell: pwsh
  74. # Step 10 (arm64): Upload the arm64 zip file as an artifact
  75. - name: Upload the arm64 artifact
  76. uses: actions/upload-artifact@v4
  77. with:
  78. name: PicView-v${{steps.get-version.outputs.version}}-win-arm64
  79. path: ${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-win-arm64/
  80. retention-days: 14
  81. # Step 10.5 (arm64): Remove .pdb files from arm64 build before installer
  82. - name: Remove .pdb files from arm64 build for installer
  83. run: |
  84. Remove-Item -Path "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64\*.pdb" -Force -ErrorAction SilentlyContinue
  85. shell: pwsh
  86. # Step 11 (arm64): Compile .ISS to .EXE Installer for arm64
  87. - name: Compile .ISS to .EXE Installer (arm64)
  88. run: |
  89. & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' `
  90. /O+ `
  91. /DMyAppVersion="${{steps.get-version.outputs.clean-version}}" `
  92. /DMyAppOutputDir="${{ github.workspace }}\Build\install" `
  93. /DMyFileSource="${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64" `
  94. /DMyAppOutputName="PicView-v${{steps.get-version.outputs.version}}-win-arm64" `
  95. /DLicenseFile="${{ github.workspace }}\src\PicView.Core\Licenses\LICENSE.txt" `
  96. /DAppIcon="${{ github.workspace }}\src\PicView.Avalonia.Win32\icon.ico" `
  97. /DVersionInfoVersion="${{steps.get-version.outputs.clean-version}}" `
  98. "${{ github.workspace }}\Build\install.iss"
  99. shell: pwsh
  100. # Step 12 (arm64): Upload Inno Setup Installer for arm64 as an artifact
  101. - name: Upload Inno Setup Installer (arm64)
  102. uses: actions/upload-artifact@v4
  103. with:
  104. name: PicView-${{steps.get-version.outputs.version}}-installer-arm64
  105. path: ${{ github.workspace }}\Build\install\PicView-v${{steps.get-version.outputs.version}}-win-arm64.exe
  106. retention-days: 14