download fails currently try another version #1 #11
Workflow file for this run
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: Compile Latex and Release PDF | |
on: | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- '*' | |
jobs: | |
build_latex: | |
runs-on: self-ubuntu-24.04 | |
outputs: | |
prefix: ${{ steps.repo_name.outputs.prefix }} | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
- name: Compile LaTeX document | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: main.tex | |
- name: Get Repository Name | |
id: repo_name | |
run: | | |
prefix=$(echo "${{ github.repository }}" | cut -d'/' -f2) | |
echo "prefix=$prefix" >> "$GITHUB_OUTPUT" | |
- name: Upload PDF | |
uses: actions/[email protected] | |
with: | |
# get the name of the repo without the organisation | |
name: PDF | |
path: main.pdf | |
download: | |
runs-on: self-ubuntu-24.04 | |
needs: build_latex | |
env: | |
versionedpdf: ${{ needs.build_latex.outputs.prefix }}.pdf | |
steps: | |
- name: Download PDF | |
uses: actions/[email protected] | |
with: | |
name: PDF | |
path: . | |
- name: Rename to add version | |
run: | | |
ls -lrt | |
mv main.pdf ${{ env.versionedpdf}} | |
ls -lrt | |
release: | |
runs-on: ubuntu-latest | |
needs: build_latex | |
if: startsWith(github.ref ,'refs/tags/v') | |
env: | |
versionedpdf: ${{ needs.build_latex.outputs.prefix }}-v${{ github.ref_name }}.pdf | |
steps: | |
- name: Download PDF | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ needs.build_latex.outputs.prefix }}.pdf | |
- name: Rename to add version | |
run: mv ${{ github.repository }}.pdf ${{ env.versionedpdf}} | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: false | |
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') || contains(github.ref, 'preview') }} | |
name: Release ${{ github.ref_name }} | |
generate_release_notes: true | |
tag_name: ${{ github.ref }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
${{ env.versionedpdf }} |