Skip to content

Commit

Permalink
Experimenting with ODK in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
joeflack4 committed Jun 20, 2023
1 parent 969d091 commit d3b9f45
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/buid_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ on:
jobs:
build_and_release:
runs-on: ubuntu-latest
# container: obolibrary/odkfull:v1.4.1
# container: obolibrary/odkfull:dev
container: obolibrary/odkfull:latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
# - name: Set up Python 3.10
# uses: actions/setup-python@v2
# with:
# python-version: '3.10'
- name: Install
# python -m pip install --upgrade pip
run: |
python -m pip install --upgrade pip
make install
- name: Create .env file
run: |
Expand All @@ -34,20 +37,29 @@ jobs:
# utcOffset: "+08:00"
format: YYYY-MM-DD
- name: build
run: make automated-release-artefacts -B
run: |
echo pwd
pwd
echo -- ls before 2nd env create
ls -a
echo -en "API_KEY=${{ secrets.API_KEY }}" > .env
echo -- ls after 2nd env create
ls -a
make all
- name: Release
run: echo Uploading files as new release.
# This one wouldn't work unless it was a tag and on-push.
# uses: softprops/action-gh-release@v1
# - name: Release
- uses: "marvinpinto/action-automatic-releases@latest"
with:
# Apparently, GITHUB_TOKEN is auto-created: https://dev.to/github/the-githubtoken-in-github-actions-how-it-works-change-permissions-customizations-3cgp
# ...even though I don't see it here: https://github.com/monarch-initiative/omim/settings/secrets/actions
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.current-time.outputs.formattedTime }}"
# title: "My Title"
title: "${{ steps.current-time.outputs.formattedTime }}"
prerelease: false
files: |
omim.ttl
# omim.sssom.tsv
omim.sssom.tsv
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all help install test scrape get-pmids automated-release cleanup
.PHONY: all help install test scrape get-pmids automated-release-artefacts cleanup


# MAIN COMMANDS / GOALS ------------------------------------------------------------------------------------------------
Expand Down
18 changes: 17 additions & 1 deletion omim2obo/config.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
import os
from pathlib import Path
import yaml
from dotenv import dotenv_values

ROOT_DIR = Path(__file__).resolve().parent.parent
DATA_DIR = ROOT_DIR / 'data'
ENV_PATH = ROOT_DIR / '.env'

with open(DATA_DIR / 'dipper/GLOBAL_TERMS.yaml') as file:
GLOBAL_TERMS = yaml.safe_load(file)

with open(DATA_DIR / 'dipper/curie_map.yaml') as file:
CURIE_MAP = yaml.safe_load(file)

config = dotenv_values(ROOT_DIR / '.env')
config = dotenv_values(ENV_PATH)
print('CONFIG')
print(config)
print('env path')
print(ENV_PATH)
print('ls root')
print(os.listdir(ROOT_DIR))

print('env contents')
with open(ENV_PATH, 'r') as file:
lines = file.readlines()
print(lines)

# TODO: get this to work:
print(str(config['API_KEY']))

0 comments on commit d3b9f45

Please sign in to comment.