Skip to content

Commit

Permalink
#230 add xslt update step into ubuntu worflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
CAMOBAP committed Feb 7, 2021
1 parent 4ec5e7c commit 08177f6
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,32 @@ jobs:
name: published-ubuntu
path: published

- uses: actions/upload-artifact@master
with:
name: xslt
path: xslt

- name: TEST Update XSLTs in processor gems
env:
GIT_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
run: |
git config --global user.name "metanorma-ci"
git config --global user.email "metanorma-ci@users.noreply.github.com"
git config credential.helper "!f() { echo \"username=metanorma-ci\\npassword=${GIT_TOKEN}\"; }; f"
make update-xslts-in-processor MN_PROCR=bipm
make update-xslts-in-processor MN_PROCR=csa
make update-xslts-in-processor MN_PROCR=cc XSLT_PREFIX=csd
make update-xslts-in-processor MN_PROCR=gb
make update-xslts-in-processor MN_PROCR=iec
make update-xslts-in-processor MN_PROCR=iho
make update-xslts-in-processor MN_PROCR=iso
make update-xslts-in-processor MN_PROCR=itu
make update-xslts-in-processor MN_PROCR=iec
make update-xslts-in-processor MN_PROCR=m3aawg XSLT_PREFIX="{m3d,jcgm}"
make update-xslts-in-processor MN_PROCR=mpfa XSLT_PREFIX=mpfd
make update-xslts-in-processor MN_PROCR=mpfa XSLT_PREFIX=ogc
make update-xslts-in-processor MN_PROCR=ribose XSLT_PREFIX=rsd
make update-xslts-in-processor MN_PROCR=un
deploy-gh-pages:
if: github.ref == 'refs/heads/master'
Expand All @@ -85,3 +111,31 @@ jobs:
ACTIONS_DEPLOY_KEY: ${{ secrets.GH_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./published

- uses: actions/checkout@master
- uses: actions/download-artifact@master
with:
name: xslt
path: xslt

- name: Update XSLTs in processor gems
env:
GIT_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
run: |
git config --global user.name "metanorma-ci"
git config --global user.email "metanorma-ci@users.noreply.github.com"
git config credential.helper "!f() { echo \"username=metanorma-ci\\npassword=${GIT_TOKEN}\"; }; f"
make update-xslts-in-processor MN_PROCR=bipm
make update-xslts-in-processor MN_PROCR=csa
make update-xslts-in-processor MN_PROCR=cc XSLT_PREFIX=csd
make update-xslts-in-processor MN_PROCR=gb
make update-xslts-in-processor MN_PROCR=iec
make update-xslts-in-processor MN_PROCR=iho
make update-xslts-in-processor MN_PROCR=iso
make update-xslts-in-processor MN_PROCR=itu
make update-xslts-in-processor MN_PROCR=iec
make update-xslts-in-processor MN_PROCR=m3aawg XSLT_PREFIX="{m3d,jcgm}"
make update-xslts-in-processor MN_PROCR=mpfa XSLT_PREFIX=mpfd
make update-xslts-in-processor MN_PROCR=mpfa XSLT_PREFIX=ogc
make update-xslts-in-processor MN_PROCR=ribose XSLT_PREFIX=rsd
make update-xslts-in-processor MN_PROCR=un
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,13 @@ else
if [ -d "images" ]; then cp -a images published; fi
endif

.PHONY: all clean update-init update-modules bundle publish xslts
MN_PROCR ?= iso
XSLT_PREFIX ?= $(MN_PROCR)
update-xslts-in-processor:
$(eval PROCR_REPO := processor/$(MN_PROCR))
[ -d $(PROCR_REPO) ] || git clone https://github.com/metanorma/metanorma-$(MN_PROCR) $(PROCR_REPO)
rsync xslt/$(XSLT_PREFIX).*.xsl $(PROCR_REPO)/lib/isodoc/$(MN_PROCR)/ --exclude *.presentation.*
git -C $(PROCR_REPO) add lib/isodoc/$(MN_PROCR)/*.xsl
git -C $(PROCR_REPO) commit -m "xslt update based on metanorma/mn-native-pdf@$(shell git rev-parse --short HEAD)" && git -C $(PROCR_REPO) --no-pager show --name-only && echo "git -C $(PROCR_REPO) push"

.PHONY: all clean update-init update-modules bundle publish xslts update-xslts-in-processor

0 comments on commit 08177f6

Please sign in to comment.