Release 2024-12-17 #36
Workflow file for this run
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 action runs when a release is created via tagging or via GitHub UI. | |
# | |
# Workflow steps: | |
# - checkout gh-pages for updating | |
# - create joined vocabulary file in addition to split version | |
# - create excel-file from turtle | |
# - build docs | |
# - publish docs, vocabulary-turtle files and excel-file to gh-pages | |
name: Publish | |
on: | |
push: | |
tags: | |
- 'v[0-9]+-[0-9]+-[0-9]+' | |
release: | |
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 | |
jobs: | |
build: | |
name: Release vocabulary & documentation | |
permissions: | |
# Required for peaceiris/actions-gh-pages below | |
contents: write | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
with: | |
# Using fetch-depth 0 is the only way to get all tags which are needed for building docs. | |
fetch-depth: 0 | |
- name: Checkout gh-pages branch to dir publish/ | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
with: | |
ref: gh-pages | |
path: publish | |
fetch-depth: 1 | |
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -VV | |
python -m pip install --upgrade pip setuptools wheel | |
# install tagged version | |
python -m pip install git+https://github.com/nfdi4cat/[email protected] | |
# python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@main | |
# install custom pylode 2.x | |
python -m pip install git+https://github.com/dalito/[email protected] | |
- name: Set dynamic environment variables. | |
run: | | |
echo "VOC4CAT_MODIFIED=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Run voc4cat (publish joined & split SKOS/turtle) | |
run: | | |
voc4cat --version | |
mkdir -p publish/latest/ | |
# delete files xlsx, xml and ttl produced in previous workflow runs | |
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/ | |
- name: Run voc4cat (build pyLODE HTML documentation) | |
run: | | |
voc4cat docs --force --logfile publish/latest/voc4cat.log publish/latest/ | |
# move versions-overview to what becomes gh-pages root | |
mv publish/latest/index.html publish/ | |
- name: Run voc4cat (build current Excel file) | |
run: | | |
voc4cat convert --logfile publish/latest/voc4cat.log --template templates/voc4cat_template_043.xlsx publish/latest/ | |
- name: Run voc4cat (build vocabulary in xml/rdf from Excel file) | |
run: | | |
voc4cat convert --logfile publish/latest/voc4cat.log --outputformat xml publish/latest/voc4cat.xlsx | |
- name: Copy release to release-name directory | |
run: | | |
mkdir -p publish/${{ github.ref_name }} | |
cp -r publish/latest/. publish/${{ github.ref_name }}/ | |
- name: Build Sphinx documentation (website) | |
run: | | |
python -VV | |
python -m pip install -r docs/requirements.txt --force | |
sphinx-build --nitpicky --fail-on-warning --keep-going docs docs/_build | |
cp -r docs/_build/. publish/ | |
- name: Deploy updated gh-pages content | |
# This replaces all prior content in gh-pages branch. But we have | |
# checked out the gh-pages branch above so that we keep all prior | |
# content and just re-publish the extended version. | |
# Pinning of action managed by dependabot | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e | |
with: | |
publish_branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./publish | |
force_orphan: true | |
- name: Store publish dir (=pages) as artifact | |
# This step is not required and may be removed. | |
# It may be helpful for troubleshooting. | |
if: ${{ always() }} | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 | |
with: | |
name: voc4cat-pages-release-${{ github.ref_name }} | |
path: publish/ | |
retention-days: 5 | |
# Lit: | |
# https://github.com/peaceiris/actions-gh-pages |