Updated workflows to build on tags instead of master

This commit is contained in:
Chapin Bryce 2020-10-15 08:21:04 -04:00
parent c56f748ca5
commit b83e1f412d
No known key found for this signature in database
GPG Key ID: AF835C2DD0747B6C
3 changed files with 82 additions and 3 deletions

70
.github/workflows/create-release.yml vendored Normal file
View File

@ -0,0 +1,70 @@
name: github pages
on:
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache install dependencies
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./requirements.txt
- name: Build docs
run: (cd doc_src && make html)
- name: Compress docs
uses: montudor/action-zip@0.1.0
with:
args: zip -qq -r docs.zip ./doc_src/_build/html
- name: Upload docs
uses: actions/upload-artifact@v2
with:
name: ${{ github.ref }}
path: docs.zip
- name: Create release
uses: actions/create-release@v1
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

View File

@ -2,8 +2,8 @@ name: github pages
on:
push:
branches:
- master
tags:
- latest
jobs:
deploy:
@ -33,6 +33,14 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Cache install dependencies
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./requirements.txt
@ -44,3 +52,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc_src/_build/html

View File

@ -21,7 +21,7 @@ author = version_info.__author__
# The full version, including alpha/beta/rc tags
release = version_info.__version__
version = datetime.datetime.now().strftime('%Y%m%d')
version = version_info.__version__
# -- General configuration ---------------------------------------------------