Atualização #20
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: pdf | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Compilação do arquivo principal | |
uses: xu-cheng/texlive-action/full@v1 | |
with: | |
run: | | |
apk add make | |
make pdf | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: book | |
path: ./main.pdf | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Obtenção da data e hora atuais | |
id: timestamp | |
run: echo "::set-output name=timestamp::$(date +'%Y-%m-%d-%H-%M-%S')" | |
- name: Criação do lançamento | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{steps.timestamp.outputs.timestamp}} | |
release_name: Versão de ${{steps.timestamp.outputs.timestamp}} | |
draft: false | |
prerelease: false | |
- uses: actions/download-artifact@v2 | |
with: | |
name: book | |
- name: Envio do PDF para o lançamento | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./main.pdf | |
asset_name: livro-pré-cálculo-reamat-v${{steps.timestamp.outputs.timestamp}}.pdf | |
asset_content_type: application/pdf |