-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflows for 0.7.0 & new release workflow
Includes template update for now optional version & modified date
- Loading branch information
Showing
6 changed files
with
156 additions
and
24 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
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,101 @@ | ||
# This action runs on merges to main. | ||
# | ||
# 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: Build & Publish | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
env: | ||
FORCE_COLOR: "1" # Make tool output pretty. | ||
PIP_DISABLE_PIP_VERSION_CHECK: "1" | ||
PIP_PROGRESS_BAR: "off" | ||
LOGLEVEL: "DEBUG" | ||
|
||
jobs: | ||
build: | ||
name: Development build of vocabulary & documentation | ||
permissions: | ||
# Required for peaceiris/actions-gh-pages below | ||
contents: write | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Checkout gh-pages branch to dir publish/ | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: gh-pages | ||
path: publish | ||
fetch-depth: 1 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- 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/voc4cat-tool.git@v0.7.0 | ||
# python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@main | ||
- name: Set dynamic environment variables. | ||
run: | | ||
echo "VOC4CAT_MODIFIED=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
# set first 8 chars of commit hash as version for "dev" | ||
echo "VOC4CAT_VERSION=v_${GITHUB_SHA:0:8}" >> $GITHUB_ENV | ||
- name: Run voc4cat (publish joined & split SKOS/turtle) | ||
run: | | ||
voc4cat --version | ||
mkdir -p publish/dev/ | ||
# delete files xlsx and ttl produced in previous workflow runs | ||
find publish/dev/ -type f \( -name "*.xlsx" -o -name "*.ttl" \) -delete | ||
cp -r vocabularies/. publish/dev/ | ||
# Build joined turtle | ||
voc4cat transform --logfile publish/dev/voc4cat.log --join publish/dev/ | ||
- name: Run voc4cat (build HTML documentation) | ||
run: | | ||
voc4cat docs --force --logfile publish/dev/voc4cat.log publish/dev/ | ||
- name: Run voc4cat (build current Excel file) | ||
run: | | ||
voc4cat convert --logfile publish/dev/voc4cat.log --template templates/voc4cat_template_043.xlsx publish/dev/ | ||
- 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. | ||
# Pin third party action (v3.9.3) | ||
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
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 trouble shooting. | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: voc4cat-pages-dev-content | ||
path: publish/ | ||
|
||
# Lit: | ||
# https://github.com/peaceiris/actions-gh-pages |
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
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
Binary file not shown.