Fix dy #4
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: Release PDF on tag | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
- name: Get repository basename | |
id: get_repo_name | |
run: echo "repo_name=$(basename $GITHUB_REPOSITORY)" > $GITHUB_OUTPUT | |
- name: Get tag basename | |
id: get_tag_name | |
run: echo "tag_name=$(basename $GITHUB_REF)" > $GITHUB_OUTPUT | |
# Questo serve nel caso in cui si usi in input il commit_hash.part per identificare le versioni | |
- name: Create commit hash file | |
run: git show -s --format=%H > commit_hash.part | |
- name: Compile LaTeX document | |
uses: xu-cheng/latex-action@v2 | |
with: | |
root_file: main.tex | |
latexmk_shell_escape: true | |
# Questo elimina il commit_hash.part | |
- name: Remove commit hash file | |
run: rm -f commit_hash.part | |
- name: Create release | |
id: create_release | |
uses: ncipollo/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
draft: false | |
prerelease: false | |
- name: Upload PDF artifact | |
id: upload-release-asset | |
uses: tanyagray/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./main.pdf | |
asset_name: ${{ github.repository }}-${{ steps.get_tag_name.outputs.tag_name }}.pdf | |
asset_content_type: pdf |