-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de5bc74
commit 41dbbc8
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Build Time Preview | ||
|
||
# Controls when the workflow will run | ||
on: | ||
push: | ||
branches: | ||
- test_time | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-java@v4 #设置jre依赖,以获取精确时间 | ||
with: | ||
distribution: "temurin" | ||
java-version: "21" #理论上8就够了 | ||
|
||
- name: Build with LaTeXmk #编译准备 | ||
uses: xu-cheng/[email protected] | ||
with: | ||
docker_image: ghcr.io/xu-cheng/texlive-full:20240501 | ||
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 }} | ||
luatex with texosquery and jre | ||
" | ||
echo $summary >> $Env:GITHUB_STEP_SUMMARY |