From 877af2fbad9b38bf9ca64c86d8dbdfe6450c0cf8 Mon Sep 17 00:00:00 2001 From: Ayende Rahien Date: Sun, 8 Feb 2015 15:59:06 +0200 Subject: [PATCH] Better handling of kindle generation --- README.md | 6 +++--- install_kindlegen.ps1 | Bin 120 -> 0 bytes mobi.ps1 | 3 --- release.ps1 | 20 ++++++++++++++++++-- 4 files changed, 21 insertions(+), 8 deletions(-) delete mode 100644 install_kindlegen.ps1 delete mode 100644 mobi.ps1 diff --git a/README.md b/README.md index 0beee25b..25a24193 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,6 @@ To create the build, run .\build.ps1 and then look in the Output directory. Create *.mobi file for Amazon Kindle ============= -1. Download [Amazon's KindleGen](http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000234621) and extract it anywhere on your PC -2. Execute 'Set-Alias -Name kindlegen -Value ' in Powershell, for example 'Set-Alias -Name kindlegen -Value C:\KindleGen\kindlegen.exe' -3. Execute mobi.ps1 and then look in the Output directory +1. Download [Amazon's KindleGen](http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000234621) and extract it to C:\tools\kindlegen (or modify the release build) +2. Execute c:\tools\kindlegen\kindlegen.exe .\Output\Inside RavenDB 3.0.epub + diff --git a/install_kindlegen.ps1 b/install_kindlegen.ps1 deleted file mode 100644 index 3695e7c81839cf6fe275c6e95d71c1b093d0d1de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 120 zcmezOpCOnbm7#<|m%))Char<8k)fDD0m$sT fISi#>70wJ+3^5GeNb20d>SD0y)dR{@Fr)$iq>UF5 diff --git a/mobi.ps1 b/mobi.ps1 deleted file mode 100644 index b71cc93f..00000000 --- a/mobi.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -$file = .\build.ps1 epub $false - -kindlegen $file \ No newline at end of file diff --git a/release.ps1 b/release.ps1 index f20358a0..c2ddb8f4 100644 --- a/release.ps1 +++ b/release.ps1 @@ -1,8 +1,10 @@ -.\build.ps1 pdf $false +.\build.ps1 pdf $true .\build.ps1 epub $false +c:\tools\kindlegen\kindlegen.exe $file + $token = Get-Content "$pwd\..\Credentials\github.txt" -$release = "v0.3.2" +$release = "v0.3.5" $json = Invoke-WebRequest -ErrorAction Stop ` -Uri "https://api.github.com/repos/ayende/book/releases" ` @@ -30,12 +32,16 @@ echo "New release id: $id" $pdf = [System.IO.File]::ReadAllBytes("$pwd\Output\Inside RavenDB 3.0.pdf") +Echo "Uploading .pdf" + Invoke-WebRequest -Uri "https://uploads.github.com/repos/ayende/book/releases/$id/assets?name=Inside RavenDB 3.0.pdf" ` -Headers @{"Authorization" = "token $token"; "Accept" = "application/vnd.github.v3+json"} ` -ContentType "application/pdf" ` -Method "POST" ` -Body $pdf +Echo "Uploading .epub" + $epub = [System.IO.File]::ReadAllBytes("$pwd\Output\Inside RavenDB 3.0.epub") Invoke-WebRequest -Uri "https://uploads.github.com/repos/ayende/book/releases/$id/assets?name=Inside RavenDB 3.0.epub" ` @@ -43,3 +49,13 @@ Invoke-WebRequest -Uri "https://uploads.github.com/repos/ayende/book/releases/$i -ContentType "application/epub+zip" ` -Method "POST" ` -Body $epub + +$mobi = [System.IO.File]::ReadAllBytes("$pwd\Output\Inside RavenDB 3.0.mobi") + +Echo "Uploading .mobi" + +Invoke-WebRequest -Uri "https://uploads.github.com/repos/ayende/book/releases/$id/assets?name=Inside RavenDB 3.0.mobi" ` + -Headers @{"Authorization" = "token $token"; "Accept" = "application/vnd.github.v3+json"} ` + -ContentType "application/octet-stream" ` + -Method "POST" ` + -Body $mobi \ No newline at end of file