TestSignWindows.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. name: Test Sign PicView on Windows
  2. run-name: workflow test 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@v5
  11. # Step 3: Get version from Directory.Build.props using PowerShell
  12. - name: Get version from Directory.Build.props
  13. id: get-version
  14. run: pwsh -File "${{ github.workspace }}/Build/Get-VersionInfo.ps1"
  15. # Step 4 (x64): Publish x64 version
  16. - name: Publish x64 version
  17. run: |
  18. pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "x64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64"
  19. shell: pwsh
  20. # Step 5 (x64): Compile .ISS to .EXE Installer for x64
  21. - name: Compile .ISS to .EXE Installer (x64)
  22. uses: Minionguyjpro/[email protected]
  23. with:
  24. path: .\Build\install.iss
  25. options: /O+ /DMyAppVersion=${{steps.get-version.outputs.file-version}} /DMyAppOutputDir=${{ github.workspace }}\Build\install /DMyFileSource=${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64 /DAppIcon=${{ github.workspace }}\src\PicView.Avalonia.Win32\icon.ico /DLicenseFile=${{ github.workspace }}\src\PicView.Core\Licenses\LICENSE.txt /DMyAppOutputName=Setup-PicView-v${{steps.get-version.outputs.version}}-win-x64
  26. # Step 6 (arm64): Publish arm64 version
  27. - name: Publish arm64 version
  28. run: |
  29. pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "arm64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64"
  30. shell: pwsh
  31. # Step 7 (arm64): Compile .ISS to .EXE Installer for arm64
  32. - name: Compile .ISS to .EXE Installer (arm64)
  33. uses: Minionguyjpro/[email protected]
  34. with:
  35. path: .\Build\install.iss
  36. options: /O+ /DMyAppVersion=${{steps.get-version.outputs.file-version}} /DMyAppOutputDir=${{ github.workspace }}\Build\install /DMyFileSource=${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64 /DAppIcon=${{ github.workspace }}\src\PicView.Avalonia.Win32\icon.ico /DLicenseFile=${{ github.workspace }}\src\PicView.Core\Licenses\LICENSE.txt /DMyAppOutputName=Setup-PicView-v${{steps.get-version.outputs.version}}-win-arm64
  37. # Step 8: Upload unsigned artifact
  38. - name: upload-unsigned-artifact
  39. id: upload-unsigned-artifact
  40. uses: actions/upload-artifact@v4
  41. with:
  42. name: "PicView-${{steps.get-version.outputs.file-version}}-unsigned"
  43. if-no-files-found: error
  44. path: |
  45. ${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64\
  46. ${{ github.workspace }}\Build\install\Setup-PicView-v${{steps.get-version.outputs.version}}-win-x64.exe
  47. ${{ github.workspace }}\Build\\PicView-v${{steps.get-version.outputs.version}}-win-arm64\
  48. ${{ github.workspace }}\Build\install\Setup-PicView-v${{steps.get-version.outputs.version}}-win-arm64.exe
  49. retention-days: 1
  50. # Step 9: Sign the binaries
  51. - name: Sign files
  52. uses: signpath/github-action-submit-signing-request@v1
  53. with:
  54. api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
  55. organization-id: '${{ vars.SIGNPATH_ORGANIZATION_ID }}'
  56. project-slug: 'PicView'
  57. signing-policy-slug: 'test-signing'
  58. github-artifact-id: ${{ steps.upload-unsigned-artifact.outputs.artifact-id }}
  59. wait-for-completion: true
  60. output-artifact-directory: 'PicView-${{steps.get-version.outputs.version}}-signed'
  61. # Step 10: Upload signed binaries
  62. - name: upload-signed-artifact
  63. uses: actions/upload-artifact@v4
  64. with:
  65. name: "PicView-${{steps.get-version.outputs.version}}-signed"
  66. path: "PicView-${{steps.get-version.outputs.version}}-signed"
  67. if-no-files-found: error