Upgrade to checkout@v4. #25
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
name: Build EpiDoc Release | |
on: | |
push: | |
tags: | |
- 'v*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: teic/teidev-docker:latest | |
steps: | |
- name: "Setup env" | |
run: | | |
export RELEASE_VERSION=${GITHUB_REF#refs/*/} | |
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | |
sh -c "git config --global --add safe.directory $PWD" | |
- name: "Checkout repo" | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- run: git checkout ${{ env.RELEASE_VERSION }} | |
- name: "Checkout gh-pages branch" | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: "Checkout latest branch" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: latest | |
path: latest | |
- name: "Build Guidelines and Schema" | |
run: | | |
export RELEASE_DIR=$(echo "$RELEASE_VERSION" | sed 's/^v//') | |
echo "RELEASE_DIR=$RELEASE_DIR" >> $GITHUB_ENV | |
guidelines/xslt/TEI-Stylesheets/bin/teitoodd schema/tei-epidoc.xml schema/tei-epidoc.compiled.xml | |
guidelines/xslt/TEI-Stylesheets/bin/teitorng schema/tei-epidoc.xml schema/tei-epidoc.rng | |
rm -rf "gh-pages/schema/$RELEASE_DIR" | |
mkdir -p "gh-pages/schema/$RELEASE_DIR" | |
rm -rf "gh-pages/schema/latest" | |
cp schema/tei-epidoc.* "gh-pages/schema/$RELEASE_DIR" | |
rsync -av --mkpath "gh-pages/schema/$RELEASE_DIR/" gh-pages/schema/latest/ | |
tree -H '.' -T 'Index of schema/' -I index.html -L 1 --noreport --charset utf-8 -o gh-pages/schema/index.html gh-pages/schema | |
tree -H '.' -T "Index of latest/" -I index.html -L 1 --noreport --charset utf-8 -o "gh-pages/schema/latest/index.html" "gh-pages/schema/latest" | |
tree -H '.' -T "Index of $RELEASE_DIR/" -I index.html -L 1 --noreport --charset utf-8 -o "gh-pages/schema/$RELEASE_DIR/index.html" "gh-pages/schema/$RELEASE_DIR" | |
xmllint --xinclude guidelines/xml/driver.xml > guidelines/xml/driver-ex.xml | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/ddbdp/examples.xml leiden-style="ddbdp" | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/dohnicht/examples.xml leiden-style="dohnicht" | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/edh-web/examples.xml leiden-style="edh-web" | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/iospe/examples.xml leiden-style="iospe" | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/london/examples.xml leiden-style="london" | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/panciera/examples.xml | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/petrae/examples.xml leiden-style="petrae" | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/rib/examples.xml leiden-style="rib" | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/seg/examples.xml leiden-style="seg" | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/createEpidocViews.xsl -o:guidelines/xml/views/verse/examples.xml verse-lines="on" | |
saxon -s:guidelines/xml/driver-ex.xml -xsl:guidelines/xslt/epidoc-html.xsl -o:guidelines/output/index.html analytics="on" attsOnSameLine="2" ignoreXmlBase="true" | |
rm -rf gh-pages/gl/previous && mv gh-pages/gl/latest gh-pages/gl/previous | |
mkdir gh-pages/gl/latest | |
rsync -av --mkpath guidelines/output/ gh-pages/gl/latest/ | |
tree -H '.' -T 'Index of gl/' -I index.html -L 1 --noreport --charset utf-8 -o gh-pages/gl/index.html gh-pages/gl | |
sed '/Previous versions/q' ReleaseNotes.txt | sed '$d' > release_notes | |
- name: "Update latest branch" | |
run: | | |
cd latest | |
git merge --ff-only origin/main | |
cd .. | |
- name: "Push to gh-pages branch" | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
repository: gh-pages | |
branch: gh-pages | |
commit_message: "Published ${{ env.RELEASE_VERSION }} release." | |
- name: "Push to latest branch" | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
repository: latest | |
branch: latest | |
commit_message: "Updated latest to ${{ env.RELEASE_VERSION }} release." | |
- name: "Create release artifacts" | |
run: | | |
cd gh-pages/schema | |
zip -r "Schema-$RELEASE_VERSION.zip" "$RELEASE_DIR" | |
mv "Schema-$RELEASE_VERSION.zip" ../../ | |
cd ../gl | |
zip -r "Guidelines-$RELEASE_VERSION.zip" "latest" | |
mv "Guidelines-$RELEASE_VERSION.zip" ../../ | |
cd ../.. | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: "EpiDoc Release ${{ env.RELEASE_VERSION }}" | |
body_path: release_notes | |
files: | | |
Schema-${{ env.RELEASE_VERSION }}.zip | |
Guidelines-${{ env.RELEASE_VERSION }}.zip | |
tag_name: ${{ env.RELEASE_VERSION }} | |