-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from weikang9009/github_action
add github action for release and doc building
- Loading branch information
Showing
4 changed files
with
123 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Building and hosting documentation for PACKAGE_NAME | ||
# | ||
# Notes: | ||
# - After the first run of this workflow: | ||
# - Within the project repo, navigate to Setting/Github Pages | ||
# - set `the source pbranch to `gh-pages/(root))`. | ||
# - Uncomment evertything below the following line to enable the workflow. | ||
#--------------------------------------------------------------------------- | ||
|
||
name: Build Docs | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Manual Doc Build | ||
default: test | ||
required: false | ||
jobs: | ||
docs: | ||
name: build & push docs | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 90 | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-latest'] | ||
environment-file: [ci/311-BASE.yaml] | ||
experimental: [false] | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: setup micromamba | ||
uses: mamba-org/provision-with-micromamba@main | ||
with: | ||
environment-file: ${{ matrix.environment-file }} | ||
micromamba-version: 'latest' | ||
|
||
- name: make docs | ||
run: cd docs; make html | ||
|
||
- name: commit docs | ||
run: | | ||
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages | ||
cp -r docs/_build/html/* gh-pages/ | ||
cd gh-pages | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Update documentation" -a || true | ||
# The above command will fail if no changes were present, | ||
# so we ignore the return code. | ||
- name: push to gh-pages | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: gh-pages | ||
directory: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
force: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Release package on GitHub and publish to PyPI | ||
# IMPORTANT -- 1 MANUAL STEP | ||
# * FOLLOWING TAGGED RELEASE | ||
# - update CHANGELOG.md | ||
#-------------------------------------------------- | ||
|
||
name: Build, Release, and publish | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Manual Release | ||
default: test | ||
required: false | ||
|
||
jobs: | ||
build: | ||
name: Create release & publish to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine jupyter urllib3 pandas pyyaml | ||
python setup.py sdist bdist_wheel | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} |
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
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