diff --git a/.github/workflows/BuildWin32.yml b/.github/workflows/BuildWin32.yml index 3e947be43..53a426c9e 100644 --- a/.github/workflows/BuildWin32.yml +++ b/.github/workflows/BuildWin32.yml @@ -27,14 +27,20 @@ jobs: - name: Get version from Directory.Build.props id: get-version run: pwsh -File "${{ github.workspace }}/Build/Get-VersionInfo.ps1" - + # Step 4 (x64): Publish x64 version - name: Publish x64 version run: | pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "x64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64" shell: pwsh - # Step 5 (x64): Upload the x64 zip file as an artifact + # Step 5 (x64): Rename files with double hyphens to single hyphen + - name: Rename files with double hyphens (x64) + run: | + Get-ChildItem -Path "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64" -Recurse -Filter "*--*" | Rename-Item -NewName { $_.Name -replace '--', '-' } + shell: pwsh + + # Step 6 (x64): Upload the x64 zip file as an artifact - name: Upload the x64 artifact uses: actions/upload-artifact@v4 with: @@ -42,14 +48,14 @@ jobs: path: ${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-win-x64/ retention-days: 14 - # Step 6 (x64): Compile .ISS to .EXE Installer for x64 + # Step 7 (x64): Compile .ISS to .EXE Installer for x64 - name: Compile .ISS to .EXE Installer (x64) uses: Minionguyjpro/Inno-Setup-Action@v1.2.5 with: path: .\Build\install.iss - 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 + options: /O+ /DMyAppVersion=${{steps.get-version.outputs.file-version}} /DMyAppOutputDir=${{ github.workspace }}\Build\install /DMyFileSource=${{ github.workspace }}\Build\PicView-v${{steps.[...] - # Step 7 (x64): Upload the Inno Setup Installer for x64 as an artifact + # Step 8 (x64): Upload the Inno Setup Installer for x64 as an artifact - name: Upload Inno Setup Installer (x64) uses: actions/upload-artifact@v4 with: @@ -57,13 +63,19 @@ jobs: path: ${{ github.workspace }}\Build\install\Setup-PicView-v${{steps.get-version.outputs.version}}-win-x64.exe retention-days: 14 - # Step 8 (arm64): Publish arm64 version + # Step 9 (arm64): Publish arm64 version - name: Publish arm64 version run: | pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "arm64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64" shell: pwsh - # Step 9 (arm64): Upload the arm64 zip file as an artifact + # Step 10 (arm64): Rename files with double hyphens to single hyphen + - name: Rename files with double hyphens (arm64) + run: | + Get-ChildItem -Path "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64" -Recurse -Filter "*--*" | Rename-Item -NewName { $_.Name -replace '--', '-' } + shell: pwsh + + # Step 11 (arm64): Upload the arm64 zip file as an artifact - name: Upload the arm64 artifact uses: actions/upload-artifact@v4 with: @@ -71,17 +83,17 @@ jobs: path: ${{ github.workspace }}/Build/PicView-v${{steps.get-version.outputs.version}}-win-arm64/ retention-days: 14 - # Step 10 (arm64): Compile .ISS to .EXE Installer for arm64 + # Step 12 (arm64): Compile .ISS to .EXE Installer for arm64 - name: Compile .ISS to .EXE Installer (arm64) uses: Minionguyjpro/Inno-Setup-Action@v1.2.5 with: path: .\Build\install.iss - 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 + options: /O+ /DMyAppVersion=${{steps.get-version.outputs.file-version}} /DMyAppOutputDir=${{ github.workspace }}\Build\install /DMyFileSource=${{ github.workspace }}\Build\PicView-v${{steps.[...] - # Step 11 (arm64): Upload the Inno Setup Installer for arm64 as an artifact + # Step 13 (arm64): Upload the Inno Setup Installer for arm64 as an artifact - name: Upload Inno Setup Installer (arm64) uses: actions/upload-artifact@v4 with: name: PicView-${{steps.get-version.outputs.version}}-installer-arm64 path: ${{ github.workspace }}\Build\install\Setup-PicView-v${{steps.get-version.outputs.version}}-win-arm64.exe - retention-days: 14 + retention-days: 14 \ No newline at end of file diff --git a/.github/workflows/ReleaseSignWindows.yaml b/.github/workflows/ReleaseSignWindows.yaml index 9a47c5ea7..717bd3dee 100644 --- a/.github/workflows/ReleaseSignWindows.yaml +++ b/.github/workflows/ReleaseSignWindows.yaml @@ -1,4 +1,4 @@ -name: Build and Sign Release on Windows +name: Release Signing on Windows run-name: workflow release signing with SignPath on: workflow_dispatch @@ -7,7 +7,7 @@ jobs: build: runs-on: windows-latest - steps: + steps: # Step 1: Checkout the code - name: Checkout repository uses: actions/checkout@v4 @@ -18,7 +18,6 @@ jobs: with: dotnet-version: '9.x' - # Step 3: Get version from Directory.Build.props using PowerShell - name: Get version from Directory.Build.props id: get-version @@ -35,7 +34,7 @@ jobs: uses: Minionguyjpro/Inno-Setup-Action@v1.2.5 with: path: .\Build\install.iss - 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 + options: /O+ /DMyAppVersion=${{steps.get-version.outputs.file-version}} /DMyAppOutputDir=${{ github.workspace }}\Build\install /DMyFileSource=${{ github.workspace }}\Build\PicView-v${{steps.[...] # Step 6 (arm64): Publish arm64 version - name: Publish arm64 version @@ -43,21 +42,25 @@ jobs: pwsh -File "${{ github.workspace }}\Build\Build Avalonia.Win32.ps1" -Platform "arm64" -outputPath "${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-arm64" shell: pwsh - # Step 7 (arm64): Compile .ISS to .EXE Installer for arm64 - name: Compile .ISS to .EXE Installer (arm64) uses: Minionguyjpro/Inno-Setup-Action@v1.2.5 with: path: .\Build\install.iss - 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 + options: /O+ /DMyAppVersion=${{steps.get-version.outputs.file-version}} /DMyAppOutputDir=${{ github.workspace }}\Build\install /DMyFileSource=${{ github.workspace }}\Build\PicView-v${{steps.[...] + # Step 8: Rename files with double hyphens to single hyphen + - name: Rename files with double hyphens + run: | + Get-ChildItem -Path "${{ github.workspace }}\Build" -Recurse -Filter "*--*" | Rename-Item -NewName { $_.Name -replace '--', '-' } + shell: pwsh - # Step 8: Upload unsigned artifact + # Step 9: Upload unsigned artifact - name: upload-unsigned-artifact id: upload-unsigned-artifact uses: actions/upload-artifact@v4 with: - name: "PicView-${{steps.get-version.outputs.file-version}}-unsigned" + name: "PicView-${{steps.get-version.outputs.file-version}}-unsigned" if-no-files-found: error path: | ${{ github.workspace }}\Build\PicView-v${{steps.get-version.outputs.version}}-win-x64\ @@ -65,8 +68,8 @@ jobs: ${{ github.workspace }}\Build\\PicView-v${{steps.get-version.outputs.version}}-win-arm64\ ${{ github.workspace }}\Build\install\Setup-PicView-v${{steps.get-version.outputs.version}}-win-arm64.exe retention-days: 1 - - # Step 9: Sign the binaries + + # Step 10: Sign the binaries - name: Sign files uses: signpath/github-action-submit-signing-request@v1 with: @@ -78,10 +81,10 @@ jobs: wait-for-completion: true output-artifact-directory: 'PicView-${{steps.get-version.outputs.version}}-signed' - # Step 10: Upload signed binaries + # Step 11: Upload signed binaries - name: upload-signed-artifact uses: actions/upload-artifact@v4 with: - name: "PicView-${{steps.get-version.outputs.version}}-signed" - path: "PicView-${{steps.get-version.outputs.version}}-signed" - if-no-files-found: error + name: "PicView-${{steps.get-version.outputs.version}}-signed" + path: "PicView-${{steps.get-version.outputs.version}}-signed" + if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/TestSignWindows.yaml b/.github/workflows/TestSignWindows.yaml index f37e5c91c..73633b3b4 100644 --- a/.github/workflows/TestSignWindows.yaml +++ b/.github/workflows/TestSignWindows.yaml @@ -1,4 +1,4 @@ -name: Build and Sign PicView on Windows +name: Test Sign PicView on Windows run-name: workflow test signing with SignPath on: workflow_dispatch