From 3cbf47d5301beed37911e79bb483a03d0b5ec8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Wei=C3=9F?= <86715435+arnoweiss@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:07:25 +0200 Subject: [PATCH] feat: deploy via respec (#41) * feat: deploy via respec * fix: duplicate releases such that paths match w3id redirects --- .github/workflows/autopublish.yaml | 42 ++++++++++++++ .github/workflows/static.yml | 47 ---------------- .gitignore | 5 ++ scripts/replace.sh | 25 +++++++++ scripts/respec-template.html | 89 ++++++++++++++++++++++++++++++ 5 files changed, 161 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/autopublish.yaml delete mode 100644 .github/workflows/static.yml create mode 100644 scripts/replace.sh create mode 100644 scripts/respec-template.html diff --git a/.github/workflows/autopublish.yaml b/.github/workflows/autopublish.yaml new file mode 100644 index 0000000..69e8e8b --- /dev/null +++ b/.github/workflows/autopublish.yaml @@ -0,0 +1,42 @@ +name: Auto-Publish +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + name: Build and Validate + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x + - name: Inject md to html + run: | + chmod +x ./scripts/replace.sh + ./scripts/replace.sh + - name: Run Respec + run: + sudo npx puppeteer browsers install chrome + npx respec --src index.html --out index.html.build.html -t 60 --disable-sandbox --verbose + - uses: actions/upload-pages-artifact@v3 + with: + path: . + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-22.04 + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml deleted file mode 100644 index bc7883f..0000000 --- a/.github/workflows/static.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Create HEAD release - shell: bash - run: |- - mkdir releases/head - rsync -Rav --prune-empty-dirs --exclude="releases/**" --include="*/" --include="**/*.json" --exclude="**" ./ ./releases/head/ - rsync -Rav --prune-empty-dirs --exclude="releases/**" --include="*/" --include="**/*.ttl" --exclude="**" ./ ./releases/head/ - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - # Upload releases folder - path: ./releases/ - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore index 2675b1f..8a7a12c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,8 @@ .DS_Store .env + +index.html +/message +/2024-1 +/v0.8 \ No newline at end of file diff --git a/scripts/replace.sh b/scripts/replace.sh new file mode 100644 index 0000000..6fcd94f --- /dev/null +++ b/scripts/replace.sh @@ -0,0 +1,25 @@ +cp scripts/respec-template.html index.html +mkdir ./message/diagram -p +cp ./**/message/diagram/*.png ./message/diagram/ +cp ./releases/* . -r +index=`cat index.html` +ovph="THIS IS THE PLACEHOLDER FOR THE OVERVIEW" +modph="THIS IS THE PLACEHOLDER FOR THE MODEL" +comph="THIS IS THE PLACEHOLDER FOR THE COMMON FUNCTIONALITIES" +cataph="THIS IS THE PLACEHOLDER FOR THE CATALOG PROTOCOL" +cnph="THIS IS THE PLACEHOLDER FOR THE CONTRACT NEGOTIATION PROTOCOL" +tpph="THIS IS THE PLACEHOLDER FOR THE TRANSFER PROCESS PROTOCOL" +ov=`cat README.md` +mod="`cat model/terminology.md`"$'\n\n'"`cat model/model.md`" +cata="`cat catalog/catalog.protocol.md`"$'\n\n'"`cat catalog/catalog.binding.https.md`" +com="`cat common/common.protocol.md`"$'\n\n'"`cat common/common.binding.https.md`" +cata="`cat catalog/catalog.protocol.md`"$'\n\n'"`cat catalog/catalog.binding.https.md`" +cn="`cat negotiation/contract.negotiation.protocol.md`"$'\n\n'"`cat negotiation/contract.negotiation.binding.https.md`" +tp="`cat transfer/transfer.process.protocol.md`"$'\n\n'"`cat transfer/transfer.process.binding.https.md`" +index="${index/$ovph/"$ov"}" +index="${index/$modph/"$mod"}" +index="${index/$comph/"$com"}" +index="${index/$cataph/"$cata"}" +index="${index/$cnph/"$cn"}" +index="${index/$tpph/"$tp"}" +echo "$index" > index.html -e \ No newline at end of file diff --git a/scripts/respec-template.html b/scripts/respec-template.html new file mode 100644 index 0000000..eb25b7f --- /dev/null +++ b/scripts/respec-template.html @@ -0,0 +1,89 @@ + + +
+ + + ++ This document is licensed under The Apache License, Version 2.0. +
++ The Dataspace Protocol is a set of specifications designed to facilitate interoperable data sharing between + entities governed by usage control and based on Web technologies. These specifications define the schemas and + protocols required for entities to publish data, negotiate Agreements, and access data as part of a federation + of technical systems termed a Dataspace. +
++ This version (2024-1) of the Dataspace Protocol specification is the release candidate and considered to be + stable. Further changes shall not affect conformity. Since version 0.8 + the specification is stable with changes in details. All changes made to the specification can be reviewed in + the GitHub repository. +
+