Skip to content

Commit

Permalink
Add release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
corvus-ch committed Jan 6, 2022
1 parent 4a7a05d commit d38e6bf
Showing 1 changed file with 39 additions and 5 deletions.
44 changes: 39 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
name: Build LaTeX documents

name: Build PDF documents
on:
workflow_call:
pull_request:
branches:
- trunk
push:
tags:
- v*

jobs:
build_latex:
build_pdf:
runs-on: ubuntu-latest
strategy:
matrix:
name:
- dotted
- gridded
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2

- name: Compile LaTeX documents
uses: xu-cheng/latex-action@v2
with:
Expand All @@ -28,7 +32,37 @@ jobs:
root_file: license.tex
latexmk_use_xelatex: true
post_compile: pdfjam --vanilla --noautoscale true --outfile ${{ matrix.name }}.pdf ${{ matrix.name }}-booklet.pdf license.pdf

- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}.pdf

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build_pdf
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set up Git repository
uses: actions/checkout@v2
with:
fetch-depth: "0"

- name: Download artifacts
uses: actions/download-artifact@v2

- name: Build changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "artifact/*"
body: ${{ steps.build_changelog.outputs.changelog }}
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d38e6bf

Please sign in to comment.