diff --git a/.github/workflows/auto-publish.yml b/.github/workflows/auto-publish.yml index e5b071d..001f2b2 100644 --- a/.github/workflows/auto-publish.yml +++ b/.github/workflows/auto-publish.yml @@ -6,10 +6,26 @@ on: jobs: main: name: Build, Validate and Deploy - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: w3c/spec-prod@v2 + - name: Checkout source... + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' + - name: Install did-rubric tooling... + working-directory: tooling + run: npm i + - name: Validate did-rubric template and criteria + working-directory: tooling + run: npm run validate-rubric + - name: Generate did rubric JSON from template and criteria + working-directory: tooling + run: npm run generate-rubric + - name: Begin W3C Spec Prod Deployment + if: github.event_name == 'push' + uses: w3c/spec-prod@v2 with: W3C_ECHIDNA_TOKEN: ${{ secrets.W3C_TR_TOKEN }} W3C_WG_DECISION_URL: https://www.w3.org/2019/did-wg/Meetings/Minutes/2021-08-17-did#resolution2 diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..8c512ff --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,50 @@ +name: Deploy GitHub Pages +on: + push: + branches: + - "**" + workflow_dispatch: {} + +permissions: + contents: write + +jobs: + build: + name: Build and Deploy Pages + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "22.x" + - name: Install tooling dependencies + working-directory: tooling + run: npm i + - name: Validate rubric + working-directory: tooling + run: npm run validate-rubric + - name: Generate rubric JS + working-directory: tooling + run: npm run generate-rubric + - name: Prepare site bundle + run: | + mkdir -p site/rubric site/tooling/src + cp index.html common.js site/ + cp rubric/rubric.js site/rubric/ + cp tooling/src/render-criteria.js site/tooling/src/ + - name: Select deploy target folder + id: deploy_target + run: | + if [ "${{ github.ref_name }}" = "main" ]; then + echo "target=" >> "$GITHUB_OUTPUT" + else + echo "target=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" + fi + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: site + target-folder: ${{ steps.deploy_target.outputs.target }} diff --git a/.gitignore b/.gitignore index 485dee6..815c569 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .idea +.history +rubric/rubric.js +node_modules/ diff --git a/README.md b/README.md index c09e87d..ad41808 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,18 @@ This is the repository of the W3C’s note on DID Method Rubric v1.0, developed by the [DID Working Group](https://www.w3.org/2019/did-wg/). The editors’ draft of the specification can also be [read directly](https://w3c.github.io/did-rubric/). +## Generate the DID Rubric from JSON + +Follow these steps to generate the DID Rubric `rubric.js` file from the +`rubric-outline.json` and `criteria` under the `rubric` folder. + +1. `cd tooling` +2. `npm install` +3. `npm run validate-rubric` +4. `npm run generate-rubric` +5. Open the `index.html` file in browser + + ## Contributing to the Repository Use the standard fork, branch, and pull request workflow to propose changes to the specification. Please make branch names informative—by including the issue or bug number for example. @@ -25,3 +37,4 @@ W3C functions under a [code of conduct](https://www.w3.org/Consortium/cepc/). * [W3C Decentralized Characteristics Rubric v1.0](https://github.com/w3c/did-rubric) * [Decentralized Identifier Use Cases v1.0](https://github.com/w3c/did-use-cases) * [W3C DID Test Suite and Implementation Report](https://github.com/w3c/did-test-suite) + diff --git a/index.html b/index.html index 049daf7..983ed66 100644 --- a/index.html +++ b/index.html @@ -3,9 +3,12 @@
-