Create unsigned release by default

This commit is contained in:
local-script 2025-05-20 12:05:29 +02:00
commit b178c4d423
5 changed files with 69 additions and 68 deletions

View file

@ -66,61 +66,62 @@ jobs:
name: drop name: drop
path: ${{ github.workspace }}/artifacts path: ${{ github.workspace }}/artifacts
# deploy: deploy:
# runs-on: windows-latest runs-on: windows-latest
# needs: build needs: build
#
# steps: steps:
#
# - name: Checkout repository - name: Checkout repository
# uses: actions/checkout@v2 uses: actions/checkout@v2
# with: with:
# fetch-depth: 0 fetch-depth: 0
#
# - name: Download build artifacts - name: Download build artifacts
# uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
# with: with:
# name: drop Name of the artifact uploaded in previous steps name: drop Name of the artifact uploaded in previous steps
# path: drop Local folder where artifacts are downloaded path: drop Local folder where artifacts are downloaded
#
# - name: Extract version from file name - name: Extract version from file name
# id: extract_version id: extract_version
# run: | run: |
# $file = Get-ChildItem drop -Filter "Greenshot-INSTALLER-*.exe" | Select-Object -First 1 $file = Get-ChildItem drop -Filter "Greenshot-INSTALLER-*.exe" | Select-Object -First 1
# if (-not $file) { if (-not $file) {
# throw "No matching file found in 'drop' directory." throw "No matching file found in 'drop' directory."
# } }
# if ($file.Name -match "Greenshot-INSTALLER-([\d\.]+).*\.exe") { if ($file.Name -match "Greenshot-INSTALLER-([\d\.]+).*\.exe") {
# echo "version=$($matches[1])" >> $Env:GITHUB_OUTPUT echo "version=$($matches[1])" >> $Env:GITHUB_OUTPUT
# } else { echo "attribs=$($matches[2])" | tr -d '-' ' ' | tr '[:upper:]' '[:lower:]' >> $Env:GITHUB_OUTPUT
# throw "Version number could not be extracted from file name: $($file.Name)" } else {
# } throw "Version number could not be extracted from file name: $($file.Name)"
# shell: pwsh }
# shell: pwsh
# - name: Create tag
# run: | - name: Create tag
# git config user.name "github-actions[bot]" run: |
# git config user.email "github-actions[bot]@users.noreply.github.com" git config user.name "github-actions[bot]"
# git tag -a "v${{ steps.extract_version.outputs.version }}" -m "v${{ steps.extract_version.outputs.version }}" git config user.email "github-actions[bot]@users.noreply.github.com"
# git push origin "v${{ steps.extract_version.outputs.version }}" git tag -a "v${{ steps.extract_version.outputs.version }}" -m "v${{ steps.extract_version.outputs.version }}"
# git push origin "v${{ steps.extract_version.outputs.version }}"
# - name: Create GitHub Release
# uses: softprops/action-gh-release@v2 - name: Create GitHub Release
# with: uses: softprops/action-gh-release@v2
# name: "Greenshot ${{ steps.extract_version.outputs.version }} unstable" with:
# tag_name: "v${{ steps.extract_version.outputs.version }}" name: "Greenshot ${{ steps.extract_version.outputs.version }}${{ steps.extract_version.outputs.attribs }}"
# files: drop/*.exe tag_name: "v${{ steps.extract_version.outputs.version }}"
# generate_release_notes: true files: drop/*.exe
# draft: true generate_release_notes: true
# prerelease: true # draft: true
# env: prerelease: true
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Trigger GitHub Pages rebuild
# shell: bash - name: Trigger GitHub Pages rebuild
# run: | shell: bash
# curl -X POST \ run: |
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ curl -X POST \
# -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# https://api.github.com/repos/${{ github.repository }}/pages/builds -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/${{ github.repository }}/pages/builds

View file

@ -13,6 +13,6 @@ jobs:
shell: bash shell: bash
run: | run: |
curl -X POST \ curl -X POST \
-H "Authorization: Bearer ${{ secrets.GH_PAT_JKL }}" \ -H "Authorization: Bearer ${{ secrets.GH_PAGES_TOKEN }}" \
-H "Accept: application/vnd.github+json" \ -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/${{ github.repository }}/pages/builds https://api.github.com/repos/${{ github.repository }}/pages/builds

View file

@ -87,7 +87,7 @@ $ReleaseData = @{
generate_release_notes = $true generate_release_notes = $true
} }
$ReleaseResponse = Invoke-RestMethod ` $ReleaseResponse = Invoke-RestMethod `
-Uri "https://api.github.com/repos/jklingen/greenshot/releases" ` -Uri "https://api.github.com/repos/greenshot/greenshot/releases" `
-Method POST ` -Method POST `
-Headers $Headers ` -Headers $Headers `
-Body (ConvertTo-Json $ReleaseData -Depth 10) -Body (ConvertTo-Json $ReleaseData -Depth 10)
@ -138,7 +138,6 @@ Write-Host "File uploaded successfully: $FileName"
# Step 7: Trigger GitHub Pages Rebuild # Step 7: Trigger GitHub Pages Rebuild
#Write-Host "Triggering GitHub Pages rebuild..." #Write-Host "Triggering GitHub Pages rebuild..."
#Invoke-RestMethod ` #Invoke-RestMethod `
# -Uri "https://api.github.com/repos/jklingen/greenshot/pages/builds" `
# -Method POST ` # -Method POST `
# -Headers $Headers # -Headers $Headers
#if ($LASTEXITCODE -ne 0) { #if ($LASTEXITCODE -ne 0) {

View file

@ -7,6 +7,7 @@
#define BinDir "bin\Release\net472" #define BinDir "bin\Release\net472"
#define ReleaseDir "..\..\src\Greenshot\bin\Release\net472" #define ReleaseDir "..\..\src\Greenshot\bin\Release\net472"
#define PluginDir "..\..\src\Greenshot\bin\Release\net472\Plugins" #define PluginDir "..\..\src\Greenshot\bin\Release\net472\Plugins"
#define CertumThumbprint GetEnv('CertumThumbprint')
; Include the scripts to install .NET Framework ; Include the scripts to install .NET Framework
; See https://www.codeproject.com/KB/install/dotnetfx_innosetup_instal.aspx ; See https://www.codeproject.com/KB/install/dotnetfx_innosetup_instal.aspx
@ -132,16 +133,16 @@ InfoBeforeFile=..\additional_files\readme.txt
LicenseFile=..\additional_files\license.txt LicenseFile=..\additional_files\license.txt
LanguageDetectionMethod=uilanguage LanguageDetectionMethod=uilanguage
MinVersion=6.1sp1 MinVersion=6.1sp1
OutputBaseFilename={#ExeName}-INSTALLER-{#Version}-UNSTABLE
OutputDir=..\ OutputDir=..\
PrivilegesRequired=lowest PrivilegesRequired=lowest
SetupIconFile=..\..\src\Greenshot\icons\applicationIcon\icon.ico SetupIconFile=..\..\src\Greenshot\icons\applicationIcon\icon.ico
; Create a SHA1 signature #if CertumThumbprint != ""
; SignTool=SignTool sign /debug /fd sha1 /tr https://time.certum.pl /td sha1 $f OutputBaseFilename={#ExeName}-INSTALLER-{#Version}-UNSTABLE
; Append a SHA256 to the previous SHA1 signature (this is what as does) SignTool=SignTool sign /sha1 "{#CertumThumbprint }" /tr http://time.certum.pl /td sha256 /fd sha256 /v $f
; SignTool=SignTool sign /debug /as /fd sha256 /tr https://time.certum.pl /td sha256 $f SignedUninstaller=yes
SignTool=SignTool sign /sha1 "{#GetEnv('CertumThumbprint')}" /tr http://time.certum.pl /td sha256 /fd sha256 /v $f #else
;SignedUninstaller=yes OutputBaseFilename={#ExeName}-INSTALLER-{#Version}-UNSTABLE-UNSIGNED
#endif
UninstallDisplayIcon={app}\{#ExeName}.exe UninstallDisplayIcon={app}\{#ExeName}.exe
Uninstallable=true Uninstallable=true
VersionInfoCompany={#ExeName} VersionInfoCompany={#ExeName}

View file

@ -76,7 +76,7 @@
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Release'"> <Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Release'">
<SetEnvironmentVariableTask Name="BuildVersionSimple" Value="$(BuildVersionSimple)" /> <SetEnvironmentVariableTask Name="BuildVersionSimple" Value="$(BuildVersionSimple)" />
<SetEnvironmentVariableTask Name="AssemblyInformationalVersion" Value="$(AssemblyInformationalVersion)" /> <SetEnvironmentVariableTask Name="AssemblyInformationalVersion" Value="$(AssemblyInformationalVersion)" />
<Exec Command='signtool.exe sign /sha1 "$(CertumThumbprint)" /tr http://time.certum.pl /td sha256 /fd sha256 /v "$(OutDir)Greenshot.exe"' /> <Exec Command="if not &quot;$(CertumThumbprint)&quot; == &quot;&quot; signtool.exe sign /sha1 &quot;$(CertumThumbprint)&quot; /tr http://time.certum.pl /td sha256 /fd sha256 /v &quot;$(OutDir)Greenshot.exe&quot;" />
<Exec Command="$(PkgTools_InnoSetup)\tools\ISCC.exe $(SolutionDir)\..\installer\innosetup\setup.iss" /> <Exec Command="$(PkgTools_InnoSetup)\tools\ISCC.exe $(SolutionDir)\..\installer\innosetup\setup.iss" />
</Target> </Target>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'"> <PropertyGroup Condition="'$(Configuration)' == 'Debug'">