Merge pull request #443 from AllenNeuralDynamics/feat-442-concentration #190
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
name: Bump version | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update_docs: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
env: | |
DIAGRAM_DIRECTORY: ./docs/source/_static/diagrams | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.DEFAULT_BRANCH }} | |
fetch-depth: 0 | |
token: ${{ secrets.SERVICE_TOKEN }} | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y graphviz graphviz-dev | |
python -m pip install -e .[dev] --no-cache-dir | |
- name: Generate new rst files | |
run: | | |
sphinx-apidoc -o docs/source/ src | |
sphinx-build -b html docs/source/ docs/build/html | |
- name: Generate diagrams | |
run: | | |
mkdir -p $DIAGRAM_DIRECTORY | |
python -m aind_data_schema.utils.erd_generator --output-directory $DIAGRAM_DIRECTORY | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
message: "updates diagrams [skip actions]" | |
add: '["*.png", "*.rst"]' | |
tag: | |
needs: update_docs | |
uses: AllenNeuralDynamics/aind-github-actions/.github/workflows/tag.yml@main | |
secrets: | |
SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }} # required | |
publish: | |
needs: tag | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Pull latest changes | |
run: git pull origin main | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
pip install --upgrade setuptools wheel twine build | |
python -m build | |
twine check dist/* | |
- name: Publish on PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1.5 | |
with: | |
password: ${{ secrets.AIND_PYPI_TOKEN }} | |
upload-schemas: | |
runs-on: ubuntu-latest | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
AWS_BUCKET: 'aind-data-schema-dev' | |
SOURCE_DIR: 'schemas' | |
steps: | |
- uses: actions/checkout@master | |
- name: Pull latest changes | |
run: git pull origin main | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.8 | |
- name: create and upload schemas | |
run: | | |
python -m pip install -e . | |
python -m aind_data_schema.utils.json_writer --output $SOURCE_DIR --attach-version | |
python -m pip install awscli | |
aws s3 sync $SOURCE_DIR s3://${AWS_BUCKET}/$SOURCE_DIR |