Skip to content

Commit

Permalink
Merge pull request #217 from swyddfa/develop
Browse files Browse the repository at this point in the history
New release v0.0.6
  • Loading branch information
alcarney authored Apr 18, 2020
2 parents de8d033 + 2643819 commit 4116618
Show file tree
Hide file tree
Showing 82 changed files with 2,817 additions and 1,258 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/blog-release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
name: Blog Build
on:
# <trigger-push>
push:
branches:
- develop
paths:
- 'blog/**'
# </trigger-push>
# <trigger-pr>
pull_request:
branches:
- develop
paths:
- 'blog/**'
# </trigger-pr>
# <trigger-cron>
schedule:
- cron: '0 6 * * *'
# </trigger-cron>

jobs:
# <build-job>
Build:
runs-on: ubuntu-latest
# </build-job>
steps:

# <build-job-setup>
- uses: actions/checkout@v1

- name: Setup Python
Expand All @@ -29,12 +41,17 @@ jobs:
python -m pip install --upgrade pip
python -m pip install --pre arlunio
python -m pip install -r blog/requirements.txt
# </build-job-setup>

# <build-job-blog>
- name: Build Gallery
run: |
cd blog
python gallery.py
# </build-job-blog>

# <build-job-deploy>
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
Expand All @@ -43,3 +60,4 @@ jobs:
BRANCH: gh-pages
FOLDER: blog/public
if: github.event_name != 'pull_request'
# </build-job-deploy>
49 changes: 49 additions & 0 deletions .github/workflows/docs-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docs Build
on:
push:
branches:
- develop
paths:
- 'arlunio/**'
- 'docs/**'
- '.github/workflows/docs-release.yml'
pull_request:
branches:
- develop
paths:
- 'arlunio/**'
- 'docs/**'
- '.github/workflows/docs-release.yml'
jobs:
Build:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Setup Environment
run: |
python --version
python -m pip install --upgrade pip
python -m pip install -e .[doc]
python -m pip install -r docs/requirements.txt
- name: Build Docs
run: |
cd docs
make html
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BASE_BRANCH: develop
BRANCH: gh-pages
FOLDER: docs/_build/html
TARGET_FOLDER: docs/
if: github.event_name != 'pull_request'
5 changes: 4 additions & 1 deletion .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ on:
branches:
- develop
- master
paths-ignore:
paths:
- 'arlunio/**'
- 'blog/**'
- 'tests/**'
- 'setup.py'
# </trigger>

jobs:
Expand Down
65 changes: 56 additions & 9 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,71 @@
name: Python Release

# <trigger>
on:
# <trigger-push>
push:
branches:
- develop
- master
paths:
- 'arlunio/**'
- 'docs/using/tutorial/**'
- 'tests/**'
- 'docs/users/**'
- 'setup.py'
- 'pyproject.toml'
- 'MANIFEST.in'
# </trigger>
# </trigger-push>
# <trigger-cron>
schedule:
- cron: '0 2 * * *'
# </trigger-cron>

jobs:
# <release-job>
Release:
runs-on: ubuntu-latest
# </release-job>
steps:
# <release-job-setup>

# <release-job-check>
- uses: actions/checkout@v1

- name: 'Should Release?'
id: dorel
run: |
if [[ "$REF" = 'refs/heads/develop' ]]; then
./scripts/should-release.sh
else
echo "::set-output name=should_release::true"
fi
env:
REF: ${{github.ref}}
# </release-job-check>

# <release-job-setup>
- name: Setup Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
if: steps.dorel.outputs.should_release

- name: Setup Environment
run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade tox
if: steps.dorel.outputs.should_release
# </release-job-setup>

# <release-job-version>
- name: Get Version Number
uses: einaregilsson/build-number@v1
with:
token: ${{secrets.github_token}}
if: github.ref == 'refs/heads/develop'
if: github.ref == 'refs/heads/develop' && steps.dorel.outputs.should_release

- name: Set Version Number
shell: bash
run : |
sed -i 's/"\(.*\)"/"\1b'"${BUILD_NUMBER}"'"/' arlunio/_version.py
cat arlunio/_version.py
if: github.ref == 'refs/heads/develop'
if: github.ref == 'refs/heads/develop' && steps.dorel.outputs.should_release

# </release-job-version>

Expand All @@ -64,12 +81,14 @@ jobs:
echo "::set-env name=RELEASE_DATE::$release_date"
echo "::set-output name=RELEASE_DATE::$release_date"
if: steps.dorel.outputs.should_release
# </release-job-info>

# <release-job-pkg>
- name: Build Package
run: |
tox -e pkg
if: steps.dorel.outputs.should_release
# </release-job-pkg>

# <release-job-assets>
Expand All @@ -81,6 +100,7 @@ jobs:
src=$(find dist/ -name '*.tar.gz' -exec basename {} \;)
echo "::set-output name=SRC::$src"
if: steps.dorel.outputs.should_release
# </release-job-assets>

# <release-job-tag>
Expand All @@ -99,6 +119,7 @@ jobs:
EOF
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.dorel.outputs.should_release
# </release-job-tag>

# <release-job-create>
Expand All @@ -112,6 +133,7 @@ jobs:
release_name: V${{ steps.info.outputs.VERSION}} - ${{ steps.info.outputs.RELEASE_DATE }}
draft: false
prerelease: ${{ github.ref == 'refs/heads/develop' }}
if: steps.dorel.outputs.should_release
# </release-job-create>

# <release-job-upload>
Expand All @@ -124,6 +146,7 @@ jobs:
asset_path: dist/${{ steps.pkg.outputs.WHL }}
asset_name: ${{ steps.pkg.outputs.WHL }}
asset_content_type: application/octet-stream
if: steps.dorel.outputs.should_release

- name: Upload Release Asset
uses: actions/[email protected]
Expand All @@ -134,11 +157,35 @@ jobs:
asset_path: dist/${{ steps.pkg.outputs.SRC }}
asset_name: ${{ steps.pkg.outputs.SRC }}
asset_content_type: application/octet-stream
if: steps.dorel.outputs.should_release
# </release-job-upload>

# <release-job-notes>
- name: Upload Release Notes
shell: bash
run: |
python -m pip install towncrier docutils
./scripts/write-release-notes.sh $VERSION > release-notes.html
notes=$(cat release-notes.html)
echo $notes
curl -s -X PATCH https://api.github.com/repos/${{ github.repository }}/releases/${{ steps.release.outputs.id }} \
-H "Authorization: token $GITHUB_TOKEN" \
-d @- << EOF
{
"body": "$notes"
}
EOF
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.dorel.outputs.should_release
# </release-job-notes>

# <release-job-pypi>
- name: Publish to PyPi
run: |
python -m pip install twine
twine upload dist/* -u alcarney -p ${{ secrets.PYPI_PASS }}
if: steps.dorel.outputs.should_release
# </release-job-pypi>
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ repos:
hooks:
- id: black
exclude: 'solutions'

- repo: local
hooks:
- id: clean-notebooks
name: clean-notebooks
entry: ./scripts/clean-notebooks.sh
language: script
files: \.ipynb$
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"editor.rulers": [
79
]
}
},
"restructuredtext.linter.disabled": true
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
"cwd": "${workspaceRoot}"
}
},
{
"label": "Build Tutorial",
"type": "shell",
"command": "source ${workspaceRoot}/.dev/bin/activate && sphinx-build -M nbtutorial docs/ docs/_build/ -E -a",
"problemMatcher": [],
"group": "build",
"options": {
"cwd": "${workspaceRoot}"
}
},
{
"label": "Edit Gallery",
"type": "shell",
Expand Down Expand Up @@ -104,6 +114,16 @@
"cwd": "${workspaceRoot}/.scratch"
}
},
{
"label": "Open Tutorial",
"type": "shell",
"command": "source ${workspaceRoot}/.dev/bin/activate && jupyter-lab",
"problemMatcher": [],
"group": "build",
"options": {
"cwd": "${workspaceRoot}/docs/_build/nbtutorial/users"
}
},
{
"label": "Test File",
"type": "shell",
Expand Down
Loading

0 comments on commit 4116618

Please sign in to comment.