Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,31 @@ jobs:
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

chocolatey:
runs-on: windows-latest
needs: create-release
if: contains(github.event.inputs.tag, 'v') && !github.event.inputs.prerelease
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download release asset
run: |
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.event.inputs.tag }}" -Headers @{Authorization="token ${{ secrets.GITHUB_TOKEN }}"}
$asset = $release.assets | Where-Object { $_.name -eq 'document-stitcher.exe' }
if ($asset) {
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile 'publishing/chocolatey/tools/document-stitcher.exe'
} else {
Write-Error "Asset not found"
}

- name: Update nuspec version
run: |
(Get-Content publishing/chocolatey/document-stitcher.nuspec) -replace '\$version\$', '${{ github.event.inputs.tag }}'.TrimStart('v') | Set-Content publishing/chocolatey/document-stitcher.nuspec

- name: Pack Chocolatey package
run: choco pack publishing/chocolatey/document-stitcher.nuspec --outputdirectory .

- name: Push to Chocolatey
run: choco push document-stitcher.${{ github.event.inputs.tag }}.TrimStart('v').nupkg --source https://push.chocolatey.org/ --api-key ${{ secrets.CHOCOLATEY_API_KEY }}
18 changes: 18 additions & 0 deletions publishing/chocolatey/document-stitcher.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>document-stitcher</id>
<version>$version$</version>
<title>Document Stitcher</title>
<authors>Taler Labs</authors>
<description>Stitch together Markdown, images, and PDFs into a single printable PDF suitable for submissions, reports, and archives.</description>
<projectUrl>https://github.com/talerlabs/document-stitcher-cli</projectUrl>
<licenseUrl>https://github.com/talerlabs/document-stitcher-cli/blob/main/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<tags>markdown pdf cli tool</tags>
<releaseNotes>https://github.com/talerlabs/document-stitcher-cli/releases</releaseNotes>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
10 changes: 10 additions & 0 deletions publishing/chocolatey/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$ErrorActionPreference = 'Stop'

$packageName = 'document-stitcher'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$exePath = Join-Path $toolsDir 'document-stitcher.exe'

# Since this is a portable app, just ensure the exe is executable
# Chocolatey will automatically add the tools directory to PATH if it's a portable package

Write-Host "Document Stitcher has been installed. You can run it with 'document-stitcher' from the command line."