Skip to content

Commit 5b06068

Browse files
author
mbarber
committed
cleanup
1 parent 9b5a86a commit 5b06068

File tree

6 files changed

+191
-3
lines changed

6 files changed

+191
-3
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release Conda Workflow
2+
3+
on:
4+
push:
5+
tags:
6+
- 'disabled'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v2
15+
16+
- name: Install Poetry
17+
run: |
18+
curl -sSL https://install.python-poetry.org | python -
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.x'
24+
25+
- name: Install Dependencies
26+
run: |
27+
poetry install
28+
29+
- name: Install testing
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install pytest pandas coverage coverage-badge
33+
34+
- name: Run tests
35+
run: |
36+
coverage run -m pytest ./tests/api/
37+
38+
- name: Build Package
39+
run: |
40+
conda build ./recipe
41+
42+
- name: Publish to PyPI
43+
uses: pypa/gh-action-pypi-publish@master
44+
with:
45+
user: __token__
46+
password: ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release Workflow
2+
3+
on:
4+
push:
5+
tags:
6+
- 'disabled'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v2
15+
16+
- name: Install Poetry
17+
run: |
18+
curl -sSL https://install.python-poetry.org | python -
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.x'
24+
25+
- name: Install Dependencies
26+
run: |
27+
poetry install
28+
29+
- name: Install testing
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install pytest pandas coverage coverage-badge
33+
34+
- name: Run tests
35+
run: |
36+
coverage run -m pytest ./tests/api/
37+
38+
- name: Build Package
39+
run: |
40+
poetry build
41+
42+
- name: Publish to PyPI
43+
uses: pypa/gh-action-pypi-publish@master
44+
with:
45+
user: __token__
46+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/s3.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Sphinx Build and Sync to S3
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- prod
8+
- test
9+
10+
jobs:
11+
build_and_sync:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v1
15+
16+
- name: Install Poetry
17+
run: |
18+
curl -sSL https://install.python-poetry.org | python -
19+
20+
- name: Install Pandoc
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y pandoc
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: '3.x'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install pytest sphinx recommonmark sphinx_markdown_tables sphinx_markdown_builder nbsphinx sphinx-rtd-theme pandas requests tqdm pydantic coverage coverage-badge
34+
35+
- name: Run tests and generate coverage badge
36+
run: |
37+
coverage run -m pytest ./tests/api/
38+
coverage html
39+
mv htmlcov apidocs/source/
40+
rm ./apidocs/source/coverage.svg
41+
coverage-badge -o apidocs/source/coverage.svg
42+
43+
- name: Build HTML with Sphinx
44+
run: |
45+
cd apidocs
46+
make html
47+
48+
- name: Get bucket name
49+
shell: bash
50+
run: |
51+
branch=$(echo ${GITHUB_REF#refs/heads/}); \
52+
if [ $branch == 'develop' ]; \
53+
then bucket=openprotein-docs-dev; \
54+
elif [ $branch == 'prod' ]; \
55+
then bucket=openprotein-docs-prod; \
56+
elif [ $branch == 'test' ]; \
57+
then bucket=openprotein-docs-dev; \
58+
else exit 1; fi; \
59+
echo $bucket; \
60+
echo "bucket=$bucket" >> $GITHUB_OUTPUT
61+
id: bucket_name
62+
63+
- name: Get distribution ID
64+
shell: bash
65+
run: |
66+
branch=$(echo ${GITHUB_REF#refs/heads/}); \
67+
if [ $branch == 'develop' ]; \
68+
then dist=E3SMW2DYY71HHW; \
69+
elif [ $branch == 'prod' ]; \
70+
then dist=E1CUT1CP31D5NK; \
71+
elif [ $branch == 'test' ]; \
72+
then dist=E3SMW2DYY71HHW; \
73+
else exit 1; fi; \
74+
echo $dist; \
75+
echo "dist=$dist" >> $GITHUB_OUTPUT
76+
id: dist_id
77+
78+
- name: Configure AWS credentials
79+
uses: aws-actions/configure-aws-credentials@v1
80+
with:
81+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
82+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
83+
aws-region: us-east-1
84+
85+
- name: Sync apidocs to S3
86+
env:
87+
AWS_S3_BUCKET: ${{ steps.bucket_name.outputs.bucket }}
88+
shell: bash
89+
run: |
90+
aws s3 sync apidocs/build/html s3://${AWS_S3_BUCKET}/apidocs/
91+
92+
- name: Invalidate CloudFront cache
93+
env:
94+
DISTRIBUTION_ID: ${{ steps.dist_id.outputs.dist }}
95+
run: |
96+
aws cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths "/apidocs/*"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SECRETS FILE
33
secrets.config
44
poetry.lock
5-
/.github/*
5+
/.github/s3.yaml
66
/htmlcov
77
/apidocs/build
88
# VS code
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source:
77

88
build:
99
noarch: python
10-
number: 1
10+
number: 2
1111
script: "{{ PYTHON }} -m pip install . --no-deps -vv"
1212

1313
requirements:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
name = "openprotein_python"
33
packages = [{include = "openprotein"}]
4-
version = "0.2.1"
4+
version = "0.2.1.post1"
55
description = "OpenProtein Python interface."
66
license = "MIT"
77
readme = "README.md"

0 commit comments

Comments
 (0)