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 f806702
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ jobs:
id: get_version
run: echo ::set-output name=VERSION::$(python -c 'print([line.split("=")[-1].strip()[1:-1] for line in open("./src/qalgebra/__init__.py", encoding="utf8").readlines() if line.startswith("__version__")][0], end="")')

- name: Get branch name
shell: bash
run: |
echo ${{ github.ref }}
echo "BRANCH_NAME=$(echo ${GITHUB_REF##*/} | tr / -)" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Zip the HTML documentation
run: zip-folder --debug --auto-root --outfile "qalgebra-docs-${{ steps.get_version.outputs.VERSION }}.zip" docs/_build/html

Expand All @@ -67,15 +60,31 @@ jobs:
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
if: startsWith(github.ref, 'refs/tags/v')
needs: build_docs
steps:

- name: Get version
shell: bash
run: |
echo ${{ github.ref }}
echo "RELEASE_VERSION=$(echo ${GITHUB_REF##*/} | cut -c 2- )" >> $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: always() && needs.build_docs.result == 'success' && (github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-18.04
needs: build_docs
needs: [build_docs, create_github_release]
steps:

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

0 comments on commit f806702

Please sign in to comment.