From a3c51e570adc814d52efacf32e9fd305190c83ff Mon Sep 17 00:00:00 2001 From: SergioEspin Date: Tue, 13 Oct 2026 14:43:11 -0400 Subject: [PATCH] Use cmd shell for Windows manual workflow --- .gitea/workflows/manual-pdf.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/manual-pdf.yml b/.gitea/workflows/manual-pdf.yml index 883d3a2..1dbc964 100644 --- a/.gitea/workflows/manual-pdf.yml +++ b/.gitea/workflows/manual-pdf.yml @@ -16,28 +16,19 @@ jobs: uses: actions/checkout@v4 - name: Generate build metadata - shell: powershell + shell: cmd run: | - $shortSha = $env:GITHUB_SHA.Substring(0, 7) - $runNumber = $env:GITHUB_RUN_NUMBER - $runAttempt = $env:GITHUB_RUN_ATTEMPT - @" - \renewcommand{\BuildIdentifier}{+build.$runNumber.$shortSha} - \renewcommand{\SourceRevision}{$shortSha} - \renewcommand{\WorkflowRunNumber}{$runNumber} - \renewcommand{\WorkflowRunAttempt}{$runAttempt} - "@ | Set-Content -Path devopsBuildMetadata.tex -Encoding ASCII + echo \renewcommand{\BuildIdentifier}{+build.%GITHUB_RUN_NUMBER%.%GITHUB_SHA:~0,7%}> devopsBuildMetadata.tex + echo \renewcommand{\SourceRevision}{%GITHUB_SHA:~0,7%}>> devopsBuildMetadata.tex + echo \renewcommand{\WorkflowRunNumber}{%GITHUB_RUN_NUMBER%}>> devopsBuildMetadata.tex + echo \renewcommand{\WorkflowRunAttempt}{%GITHUB_RUN_ATTEMPT%}>> devopsBuildMetadata.tex - name: Compile manual - shell: powershell + shell: cmd run: | latexmk -norc -pdf -shell-escape -interaction=nonstopmode -halt-on-error devopsAssignment.tex - if (-not (Test-Path devopsAssignment.pdf)) { - throw "Expected PDF was not produced." - } - if ((Get-Item devopsAssignment.pdf).Length -le 0) { - throw "Expected PDF is empty." - } + if not exist devopsAssignment.pdf exit /b 1 + for %%A in (devopsAssignment.pdf) do if %%~zA LEQ 0 exit /b 1 - name: Upload compiled PDF uses: actions/upload-artifact@v3