Generate PDF #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate PDF | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Zig | |
uses: mlugg/setup-zig@v1 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Install dependencies with Bun | |
run: bun install | |
- name: Export PDF with Bun | |
run: bun export-pdf | |
- name: Set Release Name | |
id: set_release_name | |
run: echo "RELEASE_NAME=$(TZ=Asia/Shanghai date +'%Y%m%d%H%M')" >> $GITHUB_ENV | |
- name: Configure Git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Create Tag | |
run: git tag ${{ steps.set_release_name.outputs.RELEASE_NAME }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Tag | |
run: git push origin ${{ steps.set_release_name.outputs.RELEASE_NAME }} | |
- name: Create and Upload Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: PDF/zig_course.pdf | |
tag_name: ${{ steps.set_release_name.outputs.RELEASE_NAME }} | |
name: ${{ steps.set_release_name.outputs.RELEASE_NAME }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |