diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9087747..701e282 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,6 +71,8 @@ jobs: version: ${{ inputs.nativeboat-version || 'latest' }} analyze: 'true' + # The executable needs the other files in the output folder, so only the + # whole folder is published, as a ZIP. - name: Package output shell: pwsh env: @@ -81,7 +83,6 @@ jobs: Get-ChildItem -LiteralPath $env:OUTPUT -Recurse | Format-Table FullName, Length $name = "MarkText-$env:MARKTEXT_REF-native-win-x64" New-Item -ItemType Directory -Force release | Out-Null - Copy-Item -LiteralPath $env:EXECUTABLE -Destination "release/$name.exe" Compress-Archive -Path (Join-Path $env:OUTPUT '*') -DestinationPath "release/$name.zip" Get-ChildItem release | ForEach-Object { "{0} {1}" -f (Get-FileHash -Algorithm SHA256 $_.FullName).Hash.ToLower(), $_.Name diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85a19ef..6c87eca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,8 @@ jobs: [NativeBoat $env:NATIVEBOAT](https://github.com/XTSoftwareLabs/nativeboat-release/releases/tag/$env:NATIVEBOAT). The executable runs without Chromium, WebView2 or Node.js. Download the - ``.exe`` to run it directly, or the ``.zip`` for the complete output folder. + ``.zip``, extract the whole folder, and run ``MarkText.exe`` from it; the + executable needs the other files in that folder. "@ | Set-Content -Encoding utf8NoBOM notes.md $files = (Get-ChildItem release -File).FullName gh release view $env:TAG --repo $env:GITHUB_REPOSITORY *> $null @@ -61,6 +62,11 @@ jobs: if ($exists) { gh release edit $env:TAG --repo $env:GITHUB_REPOSITORY --notes-file notes.md gh release upload $env:TAG @files --repo $env:GITHUB_REPOSITORY --clobber + # Remove files an earlier build published that this build does not. + $names = (Get-ChildItem release -File).Name + gh release view $env:TAG --repo $env:GITHUB_REPOSITORY --json assets --jq '.assets[].name' | + Where-Object { $_ -notin $names } | + ForEach-Object { gh release delete-asset $env:TAG $_ --repo $env:GITHUB_REPOSITORY --yes } } else { gh release create $env:TAG @files --repo $env:GITHUB_REPOSITORY --target $env:GITHUB_SHA ` --title "MarkText $env:TAG (native Windows)" --notes-file notes.md diff --git a/README.md b/README.md index 3eb136e..4db4c68 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,6 @@ MarkText v0.20.0 native release against the official Electron build | Threads | 111 | 8 | 93% fewer | | Handles | 2,194 | 227 | 90% fewer | -The native build also ships as a single `.exe` that runs on its own, while -the Electron build needs its whole folder. - Measured on Windows 10 22H2 with an Intel Core i7-8750H and 8 GB of RAM, opening a short Markdown file. Each figure is the median of three runs. Memory, threads and handles are summed over all of the app's processes, @@ -45,5 +42,6 @@ The [Build native MarkText](.github/workflows/build.yml) workflow: dependencies, 3. compiles `packages/desktop` with the [NativeBoat Build action](https://github.com/marketplace/actions/nativeboat-build) (`@v1`), -4. uploads the executable, a ZIP of the full output folder and - `SHA256SUMS.txt` as a workflow artifact. +4. uploads a ZIP of the full output folder and its `SHA256SUMS.txt` as a + workflow artifact. The executable needs the other files in that folder, so + it is not published on its own.