mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2025-10-06 00:22:44 +02:00
feat: release both pdf & epub
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: "Release PDF"
|
||||
name: "Release"
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
@@ -19,6 +19,7 @@ jobs:
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Show nixpkgs version
|
||||
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
|
||||
|
||||
- name: Generate PDF
|
||||
run: |
|
||||
nix develop .#export-pdf --ignore-environment --command bash -c '
|
||||
@@ -27,6 +28,13 @@ jobs:
|
||||
pnpm install
|
||||
pnpm export-pdf
|
||||
'
|
||||
- name: Generate EPUB
|
||||
run: |
|
||||
nix develop .#default --ignore-environment --command bash -c '
|
||||
set -e
|
||||
pnpm install
|
||||
pnpm run export-epub
|
||||
'
|
||||
# # For debugging, upload the pdfs as artifacts
|
||||
# - uses: actions/upload-artifact@v3
|
||||
# with:
|
||||
@@ -38,11 +46,11 @@ jobs:
|
||||
git fetch --tags
|
||||
PREVIOUS_TAG=$(git tag --sort=-creatordate | head -n 2 | tail -n 1)
|
||||
# Generate the changelog
|
||||
git log --pretty=format:"%h %s" $PREVIOUS_TAG..HEAD > CHANGELOG
|
||||
git log --pretty=format:"%h %s" "$PREVIOUS_TAG"..HEAD > CHANGELOG
|
||||
|
||||
echo "Changelog from $PREVIOUS_TAG to HEAD:"
|
||||
cat CHANGELOG
|
||||
- name: Release PDF
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
@@ -50,3 +58,4 @@ jobs:
|
||||
body_path: CHANGELOG
|
||||
files: |
|
||||
nixos-and-flakes-book.pdf
|
||||
nixos-and-flakes-book.epub
|
Reference in New Issue
Block a user