-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (67 loc) · 2.05 KB
/
build_preview.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This is a basic workflow to help you get started with Actions
name: Build Preview
# Controls when the workflow will run
on:
push:
branches:
- master
paths-ignore:
- ".github/**"
- ".gitignore"
- "**/*.md"
- "README.md"
- "LICENSE"
pull_request:
branches:
- master
paths-ignore:
- ".github/**"
- ".gitignore"
- "**/*.md"
- "README.md"
- "LICENSE"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build with LaTeXmk #编译准备
uses: xu-cheng/[email protected]
with:
docker_image: ghcr.io/xu-cheng/texlive-full:latest
root_file: main.tex
latexmk_shell_escape: true
args: |
-synctex=1
-interaction=nonstopmode
-halt-on-error
-file-line-error
extra_fonts: |
./*.otf
./*.ttf
- name: Get Time GMT+08:00 #获取系统时间
shell: pwsh
run: |
$NeedZone = [Int16]8
$OutputFormat = "%Y-%m-%d_%H.%M.%S"
$NowTime = [UInt32](Get-Date -UFormat "%s")
$Zone = [Int16](Get-Date -UFormat "%Z").ToString()
$NeedTime = ($NeedZone - $Zone) * 60 * 60
$Result = $NowTime + $NeedTime
$Formated = (Get-Date -UnixTimeSeconds $Result -UFormat $OutputFormat).ToString()
$Formated
#Rename-Item -Path ./main.pdf -NewName ($Formated + ".pdf")
"TIME_FORMATTED=$Formated" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Upload PDF file #上传pdf文件
uses: actions/upload-artifact@v4
with:
name: ${{ env.TIME_FORMATTED }}
path: main.pdf
- name: Add summary #添加编译时间到Summary
if: success()
shell: pwsh
run: |
$summary = "文件编译时间:${{ env.TIME_FORMATTED }}"
echo $summary >> $Env:GITHUB_STEP_SUMMARY