Skip to content

Commit

Permalink
Better handling of kindle generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ayende committed Feb 8, 2015
1 parent 7d07fe6 commit 877af2f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Path to your exe>' 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

Binary file removed install_kindlegen.ps1
Binary file not shown.
3 changes: 0 additions & 3 deletions mobi.ps1

This file was deleted.

20 changes: 18 additions & 2 deletions release.ps1
Original file line number Diff line number Diff line change
@@ -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" `
Expand Down Expand Up @@ -30,16 +32,30 @@ 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" `
-Headers @{"Authorization" = "token $token"; "Accept" = "application/vnd.github.v3+json"} `
-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

0 comments on commit 877af2f

Please sign in to comment.