Skip to content

Commit

Permalink
ci: Automatically generate a release from a tag, upload pdf version t…
Browse files Browse the repository at this point in the history
…o release.
  • Loading branch information
jwalton committed Apr 27, 2023
1 parent a998788 commit bf6fee1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ jobs:
pdf:
name: Generate PDF Version
runs-on: ubuntu-latest
permissions:
contents: write
needs: build
# Only run on tagged versions
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
Expand All @@ -75,10 +79,10 @@ jobs:
# Generate PDF
npx docusaurus-prince-pdf -u http://localhost:1337/rust-book-abridged --output rust-book-abridged.pdf
# Kill server
fuser -k 1337/tcp
- name: Upload PDF Artifact
uses: actions/upload-artifact@v3
fuser -k 1337/tcp
- uses: ncipollo/release-action@v1
with:
name: rust-book-abridged.pdf
path: rust-book-abridged.pdf
if-no-files-found: error
generateReleaseNotes: true
makeLatest: true
artifacts: "rust-book-abridged.pdf"
bodyFile: "body.md"
2 changes: 1 addition & 1 deletion docs/ch00-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ hide_title: true

<div align="center">
<h1>The Rust Book (Abridged)</h1>
<p>v0.2.0 - Draft</p>
<p>v0.2.1 - Draft</p>
<p>By Jason Walton</p>
<p>Based on <a href="https://doc.rust-lang.org/stable/book/">"The Rust Programming Language"</a> by Steve Klabnik and Carol Nichols.</p>
</div>
Expand Down

0 comments on commit bf6fee1

Please sign in to comment.