LDES Vocabulary Build #11
This file contains hidden or 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: LDES Vocabulary Build | |
| on: | |
| pull_request: | |
| paths: ["vocabulary.bs"] | |
| push: | |
| branches: [main] | |
| paths: ["vocabulary.bs"] | |
| tags: ["*"] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Install GraphViz | |
| run: sudo apt-get update && sudo apt-get install -y graphviz | |
| - name: Download PlantUML jar | |
| run: curl -L -o plantuml.jar https://github.com/plantuml/plantuml/releases/download/v1.2024.7/plantuml-1.2024.7.jar | |
| # Optionally check the SHA256 checksum to avoid corrupt downloads | |
| # - name: Verify PlantUML jar checksum | |
| # run: echo "<expected_sha256_here> plantuml.jar" | sha256sum -c - | |
| - name: Render .puml to .svg | |
| run: | | |
| find . -name '*.puml' -exec java -jar plantuml.jar -tsvg -o . {} + | |
| - name: Commit rendered diagrams | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add *.svg | |
| if git diff --cached --quiet; then | |
| echo "No diagram changes to commit." | |
| else | |
| git commit -m "auto-rendered PlantUML diagrams" | |
| git push | |
| fi | |
| - name: Publish Bikeshed document | |
| uses: w3c/spec-prod@v2 | |
| with: | |
| TOOLCHAIN: bikeshed | |
| # Modify as appropriate | |
| GH_PAGES_BRANCH: gh-pages | |
| # The source file | |
| SOURCE: vocabulary.bs | |
| # output filename defaults to your input | |
| # with .html extension instead, | |
| # but if you want to customize it: | |
| DESTINATION: vocabulary.html | |
| copy-tag-version: | |
| name: Copy tag snapshot | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout gh-pages | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: gh-pages | |
| fetch-depth: 0 | |
| - name: Copy vocabulary snapshot | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME}" | |
| dest="versions/${tag}" | |
| mkdir -p "${dest}" | |
| cp vocabulary.html "${dest}/vocabulary.html" | |
| if git status --porcelain | grep . >/dev/null; then | |
| git config user.email "semic-eu+github-actions[bot]@users.noreply.github.com" | |
| git config user.name "SEMIC EU archival [bot]" | |
| git add "${dest}/vocabulary.html" | |
| git commit -m "Add vocabulary snapshot for ${tag}" | |
| git push | |
| else | |
| echo "No changes to commit." | |
| fi |