-
Notifications
You must be signed in to change notification settings - Fork 26
52 lines (40 loc) · 1.32 KB
/
pdf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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 }}