ReleaseSignWindows.yaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. name: Release signing on Windows
  2. run-name: workflow release signing with SignPath
  3. on: workflow_dispatch
  4. jobs:
  5. build:
  6. runs-on: windows-latest
  7. steps:
  8. # Step 1: Checkout the code
  9. - name: Checkout repository
  10. uses: actions/checkout@v4
  11. # Step 2: Setup .NET 9 SDK
  12. - name: Setup .NET 10 SDK
  13. uses: actions/setup-dotnet@v5
  14. with:
  15. dotnet-version: '10.x'
  16. # Step 3: Get version from Directory.Build.props using PowerShell
  17. - name: Get version from Directory.Build.props
  18. id: get-version
  19. run: pwsh -File "${{ github.workspace }}/Build/Get-VersionInfo.ps1"
  20. # Step 4 (x64): Publish x64 version
  21. - name: Publish x64 version
  22. run: |
  23. pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "x64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64"
  24. shell: pwsh
  25. # Step 5: Delete all PDB files from x64 output directory
  26. - name: Remove all PDB files (x64)
  27. run: |
  28. Get-ChildItem -Path "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64" -Filter *.pdb -Recurse | Remove-Item -Force -ErrorAction SilentlyContinue
  29. shell: pwsh
  30. # Step 6 (x64): Compile .ISS to .EXE Installer for x64
  31. - name: Compile .ISS to .EXE Installer (x64)
  32. run: |
  33. New-Item -Path "${{ github.workspace }}\Build\install" -ItemType Directory -Force
  34. & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' `
  35. /O+ `
  36. /DMyAppVersion="${{steps.get-version.outputs.clean-version}}" `
  37. /DMyAppOutputDir="${{ github.workspace }}\Build\install" `
  38. /DMyFileSource="${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64" `
  39. /DMyAppOutputName="Setup-PicView-v${{steps.get-version.outputs.version}}-win-x64" `
  40. /DLicenseFile="${{ github.workspace }}\src\PicView.Core\Licenses\LICENSE.txt" `
  41. /DAppIcon="${{ github.workspace }}\src\PicView.Avalonia.Win32\icon.ico" `
  42. /DVersionInfoVersion="${{steps.get-version.outputs.clean-version}}" `
  43. "${{ github.workspace }}\Build\install.iss"
  44. shell: pwsh
  45. # Step 7 (arm64): Publish arm64 version
  46. - name: Publish arm64 version
  47. run: |
  48. pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "arm64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64"
  49. shell: pwsh
  50. # Step 8: Delete all PDB files from arm64 output directory
  51. - name: Remove all PDB files (arm64)
  52. run: |
  53. Get-ChildItem -Path "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64" -Filter *.pdb -Recurse | Remove-Item -Force -ErrorAction SilentlyContinue
  54. shell: pwsh
  55. # Step 9 (arm64): Compile .ISS to .EXE Installer for arm64
  56. - name: Compile .ISS to .EXE Installer (arm64)
  57. run: |
  58. & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' `
  59. /O+ `
  60. /DMyAppVersion="${{steps.get-version.outputs.clean-version}}" `
  61. /DMyAppOutputDir="${{ github.workspace }}\Build\install" `
  62. /DMyFileSource="${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64" `
  63. /DMyAppOutputName="Setup-PicView-v${{steps.get-version.outputs.version}}-win-arm64" `
  64. /DLicenseFile="${{ github.workspace }}\src\PicView.Core\Licenses\LICENSE.txt" `
  65. /DAppIcon="${{ github.workspace }}\src\PicView.Avalonia.Win32\icon.ico" `
  66. /DVersionInfoVersion="${{steps.get-version.outputs.clean-version}}" `
  67. "${{ github.workspace }}\Build\install.iss"
  68. shell: pwsh
  69. # Step 10: Upload unsigned artifact
  70. - name: upload-unsigned-artifact
  71. id: upload-unsigned-artifact
  72. uses: actions/upload-artifact@v4
  73. with:
  74. name: "PicView-${{steps.get-version.outputs.file-version}}-unsigned"
  75. if-no-files-found: error
  76. path: |
  77. ${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64\
  78. ${{ github.workspace }}\Build\install\Setup-PicView-v${{steps.get-version.outputs.version}}-win-x64.exe
  79. ${{ github.workspace }}\Build\\PicView-v${{steps.get-version.outputs.version}}-win-arm64\
  80. ${{ github.workspace }}\Build\install\Setup-PicView-v${{steps.get-version.outputs.version}}-win-arm64.exe
  81. retention-days: 1
  82. # Step 11: Sign the binaries
  83. - name: Sign files
  84. uses: signpath/github-action-submit-signing-request@v1
  85. with:
  86. api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
  87. organization-id: '${{ vars.SIGNPATH_ORGANIZATION_ID }}'
  88. project-slug: 'PicView'
  89. signing-policy-slug: 'release-signing'
  90. github-artifact-id: ${{ steps.upload-unsigned-artifact.outputs.artifact-id }}
  91. wait-for-completion: true
  92. output-artifact-directory: 'PicView-${{steps.get-version.outputs.version}}-signed'
  93. # Step 12: Upload signed binaries
  94. - name: upload-signed-artifact
  95. uses: actions/upload-artifact@v4
  96. with:
  97. name: "PicView-${{steps.get-version.outputs.version}}-signed"
  98. path: "PicView-${{steps.get-version.outputs.version}}-signed"
  99. if-no-files-found: error