feat: generate github release note

This commit is contained in:
Ryan Yin 2023-10-13 00:44:15 +08:00
parent e81ff2283e
commit 5981db61d1

View File

@ -25,13 +25,26 @@ jobs:
pnpm install pnpm install
pnpm export-pdf pnpm export-pdf
' '
# # For debugging, upload the pdfs as artifacts
# - uses: actions/upload-artifact@v3 # - uses: actions/upload-artifact@v3
# with: # with:
# name: pdf # name: pdf
# path: '*.pdf' # path: '*.pdf'
- name: Generate changelog
run: |
# Get the previous tag
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
echo "Changelog from $PREVIOUS_TAG to HEAD:"
cat CHANGELOG
- name: Release PDF - name: Release PDF
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
with: with:
generate_release_notes: true
body_path: CHANGELOG
files: | files: |
nixos-and-flakes-book.pdf nixos-and-flakes-book.pdf