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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# This file generated from a template file maintained in the ivoatex repository.
# To create and install it into a project repository, do:
# make github-preview
# git commit
# git push
#
name: Check the IVOA document

env:
Expand All @@ -11,29 +17,32 @@ jobs:
build:

runs-on: ubuntu-latest

steps:

- name: Checkout the repository
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
submodules: true

- name: Setup dependencies
run: |
sudo apt update
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super

sudo apt install texlive-latex-base texlive-latex-recommended \
texlive-latex-extra texlive-fonts-recommended \
librsvg2-bin latexmk \
pdftk xsltproc latexmk cm-super

- name: Build the document
run: make

- name: Check the output
run: |
test -f ${{ env.doc_name }}.pdf
test -f ${{ env.doc_name }}.bbl
- name: Keep the PDF artefact
uses: actions/upload-artifact@v1

- name: Keep the PDF artefact
uses: actions/upload-artifact@v4
with:
name: PDF Preview
path: ${{ env.doc_name }}.pdf
83 changes: 48 additions & 35 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,73 @@
# This file generated from a template file maintained in the ivoatex repository.
# To create and install it into a project repository, do:
# make github-preview
# git commit
# git push
#
name: Update PDF Preview

env:
doc_name: TAPRegExt
doc_name : TAPRegExt
branch_name: ${{ github.head_ref || github.ref_name }}
tag_preview: auto-pdf-preview

on:
push:
branches:
- master
- main

jobs:
build:

runs-on: ubuntu-latest

steps:

- name: Checkout the repository
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
submodules: true

- name: Setup dependencies
run: |
sudo apt update
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super
sudo snap install pdftk

sudo apt install texlive-latex-base texlive-latex-recommended \
texlive-latex-extra texlive-fonts-recommended \
librsvg2-bin latexmk \
pdftk xsltproc latexmk cm-super

- name: Build the document
run: make ${{ env.doc_name }}-draft.pdf

- name: Check the output
run: |
test -f ${{ env.doc_name }}-draft.pdf
test -f ${{ env.doc_name }}.bbl

- name: Move the auto-pdf-preview tag
uses: weareyipyip/walking-tag-action@v1
with:
TAG_NAME: auto-pdf-preview
TAG_MESSAGE: |
Last commit taken into account for the automatically updated PDF preview of this IVOA document.

- name: Remove the former PDF preview (if any)
run: |
existingTag=$( gh release list --exclude-drafts --json 'isPrerelease,tagName' \
--jq '.[] | select(.isPrerelease == true and .tagName == "${{ env.tag_preview }}") | .tagName' \
| xargs -n 1 echo )
if [ -n "$existingTag" ];
then
gh release delete --cleanup-tag "$existingTag"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update the PDF preview
uses: Xotl/cool-github-releases@v1
with:
mode: update
isPrerelease: true
tag_name: auto-pdf-preview
release_name: "Auto PDF Preview"
body_mrkdwn: |
This release aims to provide a PDF preview of the last commit applied on this repository.
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload the new PDF preview
run: |
RELEASE_NOTES="This release aims to provide a PDF preview of the last commit applied on this repository.
It will be updated automatically after each merge of a PullRequest.
**DO NOT PUBLISH THIS PRE-RELEASE!**"
_Corresponding commit: ${{ github.sha }}_
assets: ${{ env.doc_name }}-draft.pdf
replace_assets: true
github_token: ${{ secrets.GITHUB_TOKEN }}
**DO NOT PUBLISH THIS PRE-RELEASE!**
_Corresponding commit: ${{ github.sha }}_"

gh release create ${{ env.tag_preview }} \
${{ env.doc_name }}-draft.pdf \
--prerelease \
--target "${{ env.branch_name }}" \
--title 'Auto PDF Preview' \
--notes "$RELEASE_NOTES"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

42 changes: 22 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,32 @@ VECTORFIGURES =


# Additional files to distribute (e.g., CSS, schema files, examples...)
AUX_FILES = $(SCHEMA_FILE)
AUX_FILES = $(SCHEMA_FILE) sample.xml

-include ivoatex/Makefile

sample.xml: samplegroom.sed Makefile
# this rule only works if there's a (proper) TAP service on
# http://localhost:8080/tap
curl -s http://dc.zah.uni-heidelberg.de/__system__/tap/run/tap/capabilities \
| xmlstarlet ed -d "//languageFeatures[@type='ivo://ivoa.net/std/TAPRegExt#features-udf']/feature[not(starts-with(form, 'ivo_hashlist_has'))]" \
-d "//languageFeatures[@type='ivo://org.gavo.dc/std/exts#extra-adql-keywords']/feature[not(starts-with(form, 'MOC'))]" \
-d "//outputFormat[not(@ivo-id or mime='text/csv')]" \
-d "//capability[@standardID='ivo://ivoa.net/std/VOSI#availability']" \
-d "//dataModel[@ivo-id='ivo://org.gavo.dc/std/glots#tables-1.0']" \
| xmlstarlet fo > $@.tmp
gavo admin xsdValidate $@.tmp
sed -f samplegroom.sed $@.tmp > $@
rm $@.tmp


install:
# local to Markus' setup
fixschema $(SCHEMA_FILE) > ~/gavo/trunk/schemata/TAPRegExt.xsd

ivoatex/Makefile:
@echo "*** ivoatex submodule not found. Initialising submodules."
@echo
git submodule update --init


sample.xml: make-sample.sh
./make-sample.sh > sample.xml

install:
# local to Markus' setup
~/gavo/standards/fixschema $(SCHEMA_FILE) > ~/gavo/trunk/gavo/resources/schemata/TAPRegExt.xsd

STILTS ?= stilts
SCHEMA_FILE=TAPRegExt-v1.1.xsd

# These tests need stilts >3.4 and xmlstarlet
test:
@sh test-assertions.sh
@$(STILTS) xsdvalidate $(SCHEMA_FILE)
@$(STILTS) xsdvalidate \
schemaloc="http://www.ivoa.net/xml/TAPRegExt/v1.0=$(SCHEMA_FILE)" \
schemaloc="http://www.ivoa.net/xml/VOSICapabilities/v1.0=https://www.ivoa.net/xml/VOSICapabilities/v1.0" \
schemaloc="http://www.ivoa.net/xml/VODataService/v1.1=https://www.ivoa.net/xml/VODataService/v1.1" \
doc=sample.xml
Loading