Skip to content

Commit

Permalink
Primo commit open source
Browse files Browse the repository at this point in the history
  • Loading branch information
teobucci committed Mar 1, 2024
0 parents commit e955ae3
Show file tree
Hide file tree
Showing 42 changed files with 10,554 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/check_compilation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check compilation on push

on:
push:
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: main.tex
latexmk_shell_escape: true
56 changes: 56 additions & 0 deletions .github/workflows/release_pdf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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
Loading

0 comments on commit e955ae3

Please sign in to comment.