Skip to content

Commit

Permalink
feat: upload assets on release (#56)
Browse files Browse the repository at this point in the history
## Reason for Change

- #4 
- #7 
- create a first release of the asset data

## Changes

- add GHA to upload release assets when ontology assets are updated
- updated ontology builder to get ontology_info.yml from the
./ontology-assets directory.
- update ontology buidl to save all_ontology.json.gz to
./ontology-assets directory

## Testing steps

- generated releases using a test branch a verified the assets were
uploaded.
  • Loading branch information
Bento007 authored Feb 26, 2024
2 parents c09f2cc + 8625e6e commit 84a1c5d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 6 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,44 @@ jobs:
with:
manifest-file: ".release-please-manifest.json"
config-file: "release-please-config.json"
target-branch: main
outputs:
release_created: ${{ steps.release.outputs.ontology-assets--release_created }}
upload_url: ${{ steps.release.outputs.ontology-assets--upload_url }}

add-release-artifacts:
runs-on: [ubuntu-latest]
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
strategy:
matrix:
include:
- file_name: "ontology_info.yml"
content_type: "application/yml"
- file_name: "all_ontology.json.gz"
content_type: "application/zip"
- file_name: "cell_class_list.json"
content_type: "application/json"
- file_name: "cell_subclass_list.json"
content_type: "application/json"
- file_name: "organ_list.json"
content_type: "application/json"
- file_name: "tissue_general_list.json"
content_type: "application/json"
- file_name: "system_list.json"
content_type: "application/json"
steps:
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 1
- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.release-please.outputs.upload_url }}
asset_path: "ontology-assets/${{ matrix.file_name }}"
asset_name: ${{ matrix.file_name }}
asset_content_type: ${{ matrix.content_type }}
env:
GITHUB_TOKEN: ${{ github.token }}
Binary file added ontology-assets/all_ontology.json.gz
Binary file not shown.
36 changes: 36 additions & 0 deletions ontology-assets/ontology_info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
CL:
version: v2024-01-04
source: https://github.com/obophenotype/cell-ontology/releases/download
filetype: owl
EFO:
version: v3.62.0
source: https://github.com/EBISPOT/efo/releases/download
filetype: owl
HANCESTRO:
version: 3.0
source: https://github.com/EBISPOT/hancestro/raw/
filetype: owl
HsapDv:
version: 11
source: http://aber-owl.net/media/ontologies/HSAPDV/
filetype: owl
MONDO:
version: v2024-01-03
source: https://github.com/monarch-initiative/mondo/releases/download/
filetype: owl
MmusDv:
version: 9
source: http://aber-owl.net/media/ontologies/MMUSDV/
filetype: owl
NCBITaxon:
version: v2023-06-20
source: https://github.com/obophenotype/ncbitaxon/releases/download/
filetype: owl.gz
UBERON:
version: v2024-01-18
source: https://github.com/obophenotype/uberon/releases/download/
filetype: owl
PATO:
version: v2023-05-18
source: https://github.com/pato-ontology/pato/raw/
filetype: owl
9 changes: 3 additions & 6 deletions tools/ontology-builder/src/env.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import os

PACKAGE_ROOT = os.path.dirname(os.path.realpath(__file__))
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(PACKAGE_ROOT)))
FIXTURES_ROOT = os.path.join(ROOT_DIR, "api/python/src/cellxgene_ontology_guide/artifacts")
ONTOLOGY_REF_DIR = os.path.join(PACKAGE_ROOT, "ontology-references")
RAW_ONTOLOGY_DIR = os.path.join(ONTOLOGY_REF_DIR, "raw-files")
ONTO_INFO_YAML = os.path.join(FIXTURES_ROOT, "ontology_info.yml")
PARSED_ONTOLOGIES_FILE = os.path.join(FIXTURES_ROOT, "all_ontology.json.gz")
RAW_ONTOLOGY_DIR = os.path.join(PACKAGE_ROOT, "raw-files")
PROJECT_ROOT_DIR = os.path.realpath(__file__).rsplit("/", maxsplit=4)[0]
ONTO_INFO_YAML = os.path.join(PROJECT_ROOT_DIR, "ontology_info.yml")
PARSED_ONTOLOGIES_FILE = os.path.join(PROJECT_ROOT_DIR, "all_ontology.json.gz")
SCHEMA_DIR = os.path.join(PROJECT_ROOT_DIR, "artifact-schemas")
ONTOLOGY_ASSETS_DIR = os.path.join(PROJECT_ROOT_DIR, "ontology-assets")

0 comments on commit 84a1c5d

Please sign in to comment.