resume/.forgejo/workflows/release.yml
Leonardo Murça e9bf1ee355
Some checks failed
Compile LaTeX and Release PDF / build_latex (push) Failing after 53s
Refactor release
2025-03-06 23:12:10 -03:00

52 lines
No EOL
1.7 KiB
YAML

name: Compile LaTeX and Release PDF
on:
push:
tags:
- 'v*'
jobs:
build_latex:
runs-on: [docker] # Use your Forgejo runner with the 'docker' label
permissions:
contents: write
pull-requests: write
services:
docker:
image: docker:19.03.12-dind
options: --privileged
steps:
- name: Set up Git repository
uses: actions/checkout@v3
with:
token: ${{ secrets.RELEASE_TOKEN }} # Use RELEASE_TOKEN instead of GITHUB_TOKEN
- name: Install LaTeX
run: |
apt-get update
apt-get install -y texlive texlive-latex-extra texlive-fonts-recommended
# Step 3: Compile the LaTeX document (replace 'document.tex' with your actual file name)
- name: Compile LaTeX document
run: |
pdflatex main.tex
# Step 4: Create a new release on Forgejo
- name: Create Release
id: create_release
uses: actions/forgejo-release@v1 # Assuming this is a fork of the GitHub action for Forgejo
env:
FORGEJO_TOKEN: ${{ secrets.RELEASE_TOKEN }} # Use your Forgejo token
with:
tag_name: ${{ github.ref }} # Use the tag from the push event
release_name: ${{ github.ref }} # Use the same tag name for the release name
draft: false
prerelease: false
# Step 5: Upload the compiled PDF as a release asset
- name: Upload Release Asset
id: upload_release_asset
run: |
curl -XPOST -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-F "file=@main.pdf" \
"https://git.leomurca.xyz/api/v1/repos/${{ github.repository }}/releases/${{ steps.create_release.outputs.id }}/assets"