Skip to content

Commit

Permalink
fix: don't break with multiple specs, add ARTIFACT_NAME option (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverdunk authored Apr 16, 2024
1 parent 071d7eb commit 5cf6473
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ inputs:
description: Source file path.
DESTINATION:
description: Destination path, relative to repository root.
ARTIFACT_NAME:
description: Name for build artifact. Required when building multiple documents in same job.
default: "spec-prod-result"
BUILD_FAIL_ON:
description: Exit behaviour on errors.
default: fatal
Expand Down Expand Up @@ -123,7 +126,7 @@ runs:
path: |-
${{ steps.build.outputs.gh && fromJson(steps.build.outputs.gh).dest }}
${{ steps.build.outputs.w3c && fromJson(steps.build.outputs.w3c).dest }}
name: spec-prod-result
name: ${{ inputs.ARTIFACT_NAME }}
retention-days: 5

- name: Validate hyperlinks
Expand Down
10 changes: 7 additions & 3 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,23 @@ jobs:
max-parallel: 1
matrix:
include:
- source: spec.html
- name: spec-0
source: spec.html
destination: index.html
echidna_token: ECHIDNA_TOKEN_SPEC
- source: spec-1
- name: spec-1
source: spec-1
destination: the-spec
echidna_token: ECHIDNA_TOKEN_SPEC1
- source: spec-2
- name: spec-2
source: spec-2
# destination defaults to spec-2/index.html
# echidna_token defaults to no publication to w3.org/TR
steps:
- uses: actions/checkout@v4
- uses: w3c/spec-prod@v2
with:
ARTIFACT_NAME: ${{ matrix.name }} # required when building multiple documents in same job
SOURCE: ${{ matrix.source }}
DESTINATION: ${{ matrix.destination }}
GH_PAGES_BRANCH: gh-pages
Expand Down
8 changes: 8 additions & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ Location of generated HTML document and other assets. This is useful when you've
| `my-spec-src` | `my-spec-out` | `./my-spec-out/index.html` | `./my-spec-out/` |
| `index.html` | `index.html` | `./index.html` | `./` |

## `ARTIFACT_NAME`

Name for artifact which will be uploaded to workflow run. Required when building multiple documents in same job.

**Possible values:** Any valid artifact name.

**Default:** `"spec-prod-result"`.

## `BUILD_FAIL_ON`

Define exit behaviour on build errors or warnings.
Expand Down

0 comments on commit 5cf6473

Please sign in to comment.