Skip to content

Commit

Permalink
[ENH] release prep (#45)
Browse files Browse the repository at this point in the history
* rename branch to main, add release yml

* set ga to fetch and update release version for context url

* low GA checking frequency

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* comment out breakpoint()

* rename files, refactor code

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
yibeichan and pre-commit-ci[bot] authored Jun 21, 2024
1 parent 239efcc commit e89c3b6
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Auto-release on PR merge

on:
# ATM, this is the closest trigger to a PR merging
push:
branches:
- main

env:
AUTO_VERSION: v11.0.5

jobs:
auto-release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v3

- name: Prepare repository
# Fetch full git history and tags
run: git fetch --unshallow --tags

- name: Unset header
# checkout@v2 adds a header that makes branch protection report errors
# because the Github action bot is not a collaborator on the repo
run: git config --local --unset http.https://github.com/.extraheader

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Download auto
run: |
auto_download_url="$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/tags/$AUTO_VERSION | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')"
wget -O- "$auto_download_url" | gunzip > ~/auto
chmod a+x ~/auto
- name: Create release
run: |
~/auto shipit -vv
env:
GH_TOKEN: ${{ secrets.AUTO_ORG_TOKEN }}
10 changes: 1 addition & 9 deletions reproschema/jsonldutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@
from pyld import jsonld

from .context_url import CONTEXTFILE_URL
from .models import (
Activity,
Item,
Protocol,
Response,
ResponseActivity,
ResponseOption,
identify_model_class,
)
from .models import identify_model_class
from .utils import fixing_old_schema, lgr, start_server, stop_server


Expand Down
14 changes: 3 additions & 11 deletions reproschema/reproschema2redcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,9 @@
import requests

from .context_url import CONTEXTFILE_URL
from .jsonldutils import _is_file, _is_url, load_file
from .models import (
Activity,
Item,
Protocol,
Response,
ResponseActivity,
ResponseOption,
write_obj_jsonld,
)
from .utils import fixing_old_schema, start_server, stop_server
from .jsonldutils import _is_url, load_file
from .models import Activity, Item, Protocol, ResponseOption
from .utils import start_server, stop_server


def fetch_choices_from_url(url):
Expand Down

0 comments on commit e89c3b6

Please sign in to comment.