-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
188 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build schemas | ||
|
||
# when main changed rebuild the products (schemas and documentations) and updates the build folder | ||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build main branch | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.9' ] | ||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | ||
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
- name: Install dependencies | ||
run: | | ||
poetry install | ||
- name: Generate merged schemas | ||
run: | | ||
cp src/cell_annotation_schema/schema/cell_annotation_schema.yaml build/general_schema.yaml | ||
gen-linkml src/cell_annotation_schema/schema/BICAN/BICAN_schema.yaml --output build/BICAN_schema.yaml --mergeimports --format yaml --no-materialize-attributes | ||
gen-linkml src/cell_annotation_schema/schema/CAP/CAP_schema.yaml --output build/CAP_schema.yaml --mergeimports --format yaml --no-materialize-attributes | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git diff --quiet && git diff --staged --quiet || git commit -a -m "Main branch build" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.P_TOKEN }} | ||
branch: ${{ github.head_ref }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Nightly Snapshot | ||
|
||
on: | ||
schedule: | ||
- cron: "59 23 * * *" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
tag: | ||
name: Make snapshot release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.9' ] | ||
steps: | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
|
||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
- name: Install dependencies | ||
run: | | ||
poetry install | ||
- name: Generate merged schemas | ||
run: | | ||
cp src/cell_annotation_schema/schema/cell_annotation_schema.yaml build/general_schema.yaml | ||
gen-linkml src/cell_annotation_schema/schema/BICAN/BICAN_schema.yaml --output build/BICAN_schema.yaml --mergeimports --format yaml --no-materialize-attributes | ||
gen-linkml src/cell_annotation_schema/schema/CAP/CAP_schema.yaml --output build/CAP_schema.yaml --mergeimports --format yaml --no-materialize-attributes | ||
- name: Make Snapshot | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "build/general_schema.yaml, | ||
build/BICAN_schema.yaml,build/CAP_schema.yaml" | ||
body: "Nightly snapshot release. Draft only, please use a stable release instead." | ||
allowUpdates: true | ||
draft: true | ||
makeLatest: false | ||
name: "${{ steps.date.outputs.date }} SNAPSHOT" | ||
removeArtifacts: true | ||
tag: "snapshot" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
name: Publish Python Package | ||
|
||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Poetry | ||
run: | | ||
pipx install poetry | ||
poetry self add "poetry-dynamic-versioning[plugin]" | ||
- name: Install dependencies | ||
run: poetry install --no-interaction | ||
|
||
- name: Generate merged schemas | ||
run: | | ||
cp src/cell_annotation_schema/schema/cell_annotation_schema.yaml build/general_schema.yaml | ||
gen-linkml src/cell_annotation_schema/schema/BICAN/BICAN_schema.yaml --output build/BICAN_schema.yaml --mergeimports --format yaml --no-materialize-attributes | ||
gen-linkml src/cell_annotation_schema/schema/CAP/CAP_schema.yaml --output build/CAP_schema.yaml --mergeimports --format yaml --no-materialize-attributes | ||
- name: Package release assets | ||
run: | | ||
mkdir -p src/cell_annotation_schema/schemas | ||
touch src/cas_schema/schemas/__init__.py | ||
cp build/general_schema.yaml src/cell_annotation_schema/schemas | ||
cp build/BICAN_schema.yaml src/cell_annotation_schema/schemas | ||
cp build/CAP_schema.yaml src/cell_annotation_schema/schemas | ||
- name: Update package version | ||
run: | | ||
sed -i 's/__version__/${{ github.ref_name }}/g' pyproject.toml | ||
- name: Build source and wheel archives | ||
run: poetry build | ||
|
||
- name: Publish Package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "cell_annotation_schema" | ||
version = "1.1.0" | ||
version = "__version__" | ||
description = "General, open-standard schema for cell annotations" | ||
authors = ["Huseyin Kir <[email protected]>"] | ||
license = "GNU GPL v3.0" | ||
|