Skip to content

Commit

Permalink
Make releases from workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
goerz committed Dec 27, 2020
1 parent 6b443de commit e3e35e0
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ jobs:
run: tox -e docs

- name: Generate LaTeX Documentation
if: startsWith(github.ref, 'refs/tags/')
run: |
tox -e docs -- -b latex docs/_build/latex
tox -e run-cmd -- python docs/sources/build_pdf.py --patch-only docs/_build/latex/*.tex
- uses: xu-cheng/latex-action@v2
if: startsWith(github.ref, 'refs/tags/')
name: Compile LaTex (first pass)
with:
compiler: lualatex
Expand All @@ -39,6 +41,7 @@ jobs:
root_file: qalgebra.tex

- uses: xu-cheng/latex-action@v2
if: startsWith(github.ref, 'refs/tags/')
name: Compile LaTex (second pass)
with:
compiler: lualatex
Expand All @@ -61,21 +64,37 @@ jobs:
run: zip-folder --debug --auto-root --outfile "qalgebra-docs-${{ steps.get_version.outputs.VERSION }}.zip" docs/_build/html

- name: Rename the PDF documentation
if: startsWith(github.ref, 'refs/tags/')
run: mv docs/_build/latex/qalgebra.pdf "qalgebra-docs-${{ steps.get_version.outputs.VERSION }}.pdf"

- uses: actions/upload-artifact@v2
name: Upload documentation artifacts
with:
name: qalgebra-docs
# We need at least two files in the artifact to avoid a weird
# double-zip file. Hence README.md
path: |
./qalgebra-docs-${{ steps.get_version.outputs.VERSION }}.zip
./qalgebra-docs-${{ steps.get_version.outputs.VERSION }}.pdf
README.md
./qalgebra-docs-${{ steps.get_version.outputs.VERSION }}.*
create_github_release:
name: Create a Github Release
runs-on: ubuntu-18.04
needs: build_docs
steps:

- name: Get version
shell: bash
run: |
echo ${{ github.ref }}
#echo "BRANCH_NAME=$(echo ${GITHUB_REF##*/} | tr / -)" >> $GITHUB_ENV
cat $GITHUB_ENV
deploy_gh_pages:
name: Deploy documentation to gh-pages
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
if: github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-18.04
needs: build_docs
needs: create_github_release
steps:

- uses: actions/setup-python@v2
Expand Down

0 comments on commit e3e35e0

Please sign in to comment.