Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Thank you for opening a Pull Request! Before submitting, please confirm:

- [ ] I have not copied concept definitions from sources with licenses incompatible with voc4cat's CC0 license (e.g., copyleft licenses like CC-BY-SA).
- [ ] I have cited sources that influenced my definitions (in Influenced by IRIs) or from which definitions were adapted (in Source Vocab IRI). Note: You may cite IUPAC Goldbook as an influence, but not copy its definitions verbatim due to its CC-BY-SA license.
- [ ] I have created a meaningful PR title and referenced any related issues.

<!--- Explain the why and what of your PR next. --->
44 changes: 26 additions & 18 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@ on:
# forks. Since the workflow only accesses the xlsx and turtle files, but does
# not run any code, it is safe to use pull_request_target. More info:
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
# zizmor: ignore[dangerous-triggers] OK as per comment above
pull_request_target:
branches:
- main
types: [opened, reopened, synchronize]
workflow_dispatch:

env:
FORCE_COLOR: "1" # Make tool output pretty.
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_PROGRESS_BAR: "off"
LOGLEVEL: "DEBUG"
RUN_URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
build_vocab:
name: Merge & build vocabulary
Expand All @@ -29,29 +35,31 @@ jobs:
timeout-minutes: 10

permissions:
# Give the default GITHUB_TOKEN write permission to commit to the PR branch.
contents: write
contents: write # Give the default GITHUB_TOKEN write permission to commit to the PR branch.

steps:
- name: Checkout PR branch into cwd
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
# Checkout the fork/head-repository to push changes to the fork.
# Without this the base repository will be checked out and committed to.
repository: ${{ github.event.pull_request.head.repo.full_name }}

# Checkout the branch made in the fork.
ref: ${{ github.head_ref }}
# Be specific about keeping credentials (it is the default)
persist-credentials: true

- name: Checkout main branch into directory _main_branch/
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
ref: main
path: _main_branch
# This sparse-checkout includes all toplevel files and everything below vocabularies/
sparse-checkout: |
vocabularies/
fetch-depth: 1
# Be specific about keeping credentials (it is the default)
persist-credentials: true

- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
Expand All @@ -62,19 +70,16 @@ jobs:
python -VV
python -m pip install --upgrade pip setuptools wheel

# install tagged version
python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@v0.10.0
# Select to install a stable tagged version or main branch (in development)
python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@v1.0.0
# python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@main

# install custom pylode 2.x (adds sorted collections,
# uses URIs as fragment IDs and is git-installable)
python -m pip install git+https://github.com/dalito/pyLODE.git@nfdi4cat-2.x

# Example for installing from private repo:
# python -m pip install git+https://anon:${{ SECRETS.READ_PAT_VOC4CAT }}@github.com/dalito/voc4cat-tool.git@main

- name: Set dynamic environment variables.
run: |
run: | # zizmor: ignore[github-env] safe without user controllable input
echo "RUN_DATE=$(date +'%Y-%m-%dT%H%M')" >> $GITHUB_ENV

- name: Run voc4cat (pre-convert checks)
Expand All @@ -91,34 +96,37 @@ jobs:
voc4cat convert --config _main_branch/idranges.toml --logfile outbox/voc4cat.log --outdir outbox inbox-excel-vocabs/
if [ ! -f outbox/*.ttl ]; then
echo "No ttl file in outbox. Building joined vocabulary ttl-file from individual ttl-files in vocabulary."
voc4cat transform --join --logfile outbox/voc4cat.log --outdir outbox/ vocabularies/
voc4cat transform --join --config _main_branch/idranges.toml --logfile outbox/voc4cat.log --outdir outbox/ vocabularies/
fi

- name: Run voc4cat (post-convert checks)
run: |
# check all ttl file(s) in outbox
voc4cat check --config _main_branch/idranges.toml --logfile outbox/voc4cat.log outbox/
voc4cat check --redundant-hierarchies --config _main_branch/idranges.toml --logfile outbox/voc4cat.log outbox/
# check if vocabulary changes are allowed
voc4cat check --config _main_branch/idranges.toml --logfile outbox/voc4cat.log --ci-post _main_branch/vocabularies outbox/

- name: Run voc4cat (build HTML documentation)
run: |
voc4cat docs --logfile outbox/voc4cat.log --force outbox/

- name: Split vocabulary and merge into vocabulary dir (in PR branch)
- name: Split vocabulary, merge into vocabulary dir (in PR branch) and update provenance info
run: |
voc4cat transform --split --inplace --logfile outbox/voc4cat.log --outdir outbox_new_voc outbox/
voc4cat transform --split --inplace --config idranges.toml --logfile outbox/voc4cat.log --outdir outbox_new_voc outbox/
voc4cat-merge --logfile outbox/voc4cat.log outbox_new_voc/ vocabularies/
# copy xlsx to outbox so that the xlsx file is part of the artifact
find inbox-excel-vocabs -name '*.xlsx' -exec cp {} -t outbox/ \;
git status
# Add/update dct:created and dct:modified base on git history
voc4cat transform --prov-from-git --inplace --config idranges.toml --logfile outbox/voc4cat.log vocabularies/

- name: Run voc4cat (re-build updated Excel file and joined turtle vocabulary file)
# Passing the config is important to make use of the prefixes therein.
run: |
mkdir -p outbox/updated-xlsx-ttl
voc4cat transform --config idranges.toml --logfile outbox/voc4cat.log -O outbox/updated-xlsx-ttl --join vocabularies/
voc4cat convert --config idranges.toml --logfile outbox/voc4cat.log --template templates/voc4cat_template_043.xlsx outbox/updated-xlsx-ttl
voc4cat transform --join --config idranges.toml --logfile outbox/voc4cat.log --outdir outbox/updated-xlsx-ttl vocabularies/
# Using a template is optional and gives just a warning if missing.
voc4cat convert --config idranges.toml --logfile outbox/voc4cat.log --template templates/default_sheets.xlsx outbox/updated-xlsx-ttl

- name: Store artifacts
if: ${{ always() }}
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,39 @@ on:
workflow_dispatch:

env:
FORCE_COLOR: "1" # Make tool output pretty.
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_PROGRESS_BAR: "off"
LOGLEVEL: "DEBUG"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
build:
name: Development build of vocabulary & documentation
permissions:
# Required for peaceiris/actions-gh-pages below
contents: write
contents: write # Required for peaceiris/actions-gh-pages below
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
# Using fetch-depth 0 is the only way to get all tags which are needed for building docs.
fetch-depth: 0
# Be specific about keeping credentials (it is the default)
persist-credentials: true

- name: Checkout gh-pages branch to dir publish/
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
ref: gh-pages
path: publish
fetch-depth: 1
# Be specific about keeping credentials (it is the default)
persist-credentials: true

- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
Expand All @@ -58,8 +66,8 @@ jobs:
python -VV
python -m pip install --upgrade pip setuptools wheel

# install tagged version
python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@v0.10.0
# Select to install a stable tagged version or main branch (in development)
python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@v1.0.0
# python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@main

# install custom pylode 2.x
Expand All @@ -79,7 +87,7 @@ jobs:
find publish/dev/ -type f \( -name "*.xlsx" -o -name "*.ttl" -o -name "*.xml" \) -delete
cp -r vocabularies/. publish/dev/
# Build joined turtle
voc4cat transform --logfile publish/dev/voc4cat.log --join publish/dev/
voc4cat transform --join --config idranges.toml --logfile publish/dev/voc4cat.log publish/dev/

- name: Run voc4cat (build pyLODE HTML documentation)
run: |
Expand All @@ -90,7 +98,8 @@ jobs:
- name: Run voc4cat (build current Excel file)
# Passing the config is important to make use of the prefixes therein.
run: |
voc4cat convert --config idranges.toml --logfile publish/dev/voc4cat.log --template templates/voc4cat_template_043.xlsx publish/dev/
# Using a template is optional and gives just a warning if missing.
voc4cat convert --config idranges.toml --logfile publish/dev/voc4cat.log --template templates/default_sheets.xlsx publish/dev/

- name: Run voc4cat (build vocabulary in xml/rdf from Excel file)
run: |
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ on:
branches:
- main

permissions:
pull-requests: write
contents: read
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check-pr-submission:
name: Check PR submission best practices
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # to post a message to PR

steps:
- name: Check if PR is from main branch of fork
Expand Down
31 changes: 20 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,40 @@ on:
types: [published]

env:
FORCE_COLOR: "1" # Make tool output pretty.
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_PROGRESS_BAR: "off"
LOGLEVEL: "DEBUG"
VOC4CAT_VERSION: ${{github.ref_name}} # use release tag as version

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
build:
name: Release vocabulary & documentation
permissions:
# Required for peaceiris/actions-gh-pages below
contents: write
contents: write # Required for peaceiris/actions-gh-pages below
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
# Using fetch-depth 0 is the only way to get all tags which are needed for building docs.
fetch-depth: 0
# Be specific about keeping credentials (it is the default)
persist-credentials: true

- name: Checkout gh-pages branch to dir publish/
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
ref: gh-pages
path: publish
fetch-depth: 1
# Be specific about keeping credentials (it is the default)
persist-credentials: true

- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
Expand All @@ -52,8 +60,8 @@ jobs:
python -VV
python -m pip install --upgrade pip setuptools wheel

# install tagged version
python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@v0.10.0
# Select to install a stable tagged version or main branch (in development)
python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@v1.0.0
# python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@main

# install custom pylode 2.x
Expand All @@ -71,7 +79,7 @@ jobs:
find publish/latest/ -type f \( -name "*.xlsx" -o -name "*.ttl" -o -name "*.xml" \) -delete
cp -r vocabularies/. publish/latest/
# Build joined turtle
voc4cat transform --logfile publish/latest/voc4cat.log --join publish/latest/
voc4cat transform --join --config idranges.toml --logfile publish/latest/voc4cat.log publish/latest/

- name: Run voc4cat (build pyLODE HTML documentation)
run: |
Expand All @@ -82,7 +90,8 @@ jobs:
- name: Run voc4cat (build current Excel file)
# Passing the config is important to make use of the prefixes therein.
run: |
voc4cat convert --config idranges.toml --logfile publish/latest/voc4cat.log --template templates/voc4cat_template_043.xlsx publish/latest/
# Using a template is optional and gives just a warning if missing.
voc4cat convert --config idranges.toml --logfile publish/latest/voc4cat.log --template templates/default_sheets.xlsx publish/latest/

- name: Run voc4cat (build vocabulary in xml/rdf from Excel file)
# Passing the config is important to make use of the prefixes therein.
Expand All @@ -91,8 +100,8 @@ jobs:

- name: Copy release to release-name directory
run: |
mkdir -p publish/${{ github.ref_name }}
cp -r publish/latest/. publish/${{ github.ref_name }}/
mkdir -p publish/${GITHUB_REF_NAME}
cp -r publish/latest/. publish/${GITHUB_REF_NAME}/

- name: Build Sphinx documentation (website)
run: |
Expand Down
8 changes: 4 additions & 4 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
{
"name": "Schumann, Julia",
"orcid": "0000-0002-4041-0165",
"affiliation": "Physics Department and CSMB, Humboldt-Universität zu Berlin, Zum Großen Windkanal 2, 12489 Berlin, Germany"
"affiliation": "Physics Department and CSMB, Humboldt-Universität zu Berlin, Zum Großen Windkanal 2, 12489 Berlin, Germany"
},
{
"name": "Götte, Michael",
"name": "Götte, Michael",
"orcid": "0009-0008-1278-8890",
"affiliation": "Helmholtz-Zentrum Berlin für Materialien und Energie, 14109 Berlin, Germany"
"affiliation": "Helmholtz-Zentrum Berlin für Materialien und Energie, 14109 Berlin, Germany"
},
{
"name": "Borgelt, Hendrik",
Expand All @@ -41,7 +41,7 @@
{
"name": "Terboven, Carla",
"orcid": "0009-0004-3786-0773",
"affiliation": "Helmholtz-Zentrum Berlin für Materialien und Energie"
"affiliation": "Helmholtz-Zentrum Berlin für Materialien und Energie"
},
{
"name": "Flecken, Franziska",
Expand Down
Loading
Loading