Skip to content

Commit 470026e

Browse files
refactor(ci): use artifact output path
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
1 parent ac849e7 commit 470026e

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

.github/actions/mdbook/action.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ inputs:
3838
default: "0.7.7"
3939
description: |
4040
Version of mdbook-linkcheck to use (ex. '0.7.7')
41-
env:
42-
ARTIFACT_PATH: ./component-model/book/html
4341
4442
runs:
4543
using: composite
@@ -60,15 +58,18 @@ runs:
6058
with:
6159
tool: "mdbook-linkcheck@${{ inputs.mdbook-linkcheck-version }}"
6260

63-
- name: Build with mdBook
64-
shell: bash
65-
run: mdbook build component-model
66-
6761
- name: Setup Python
6862
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
6963
with:
7064
python-version: '3.13'
7165

66+
- name: Build with mdBook
67+
shell: bash
68+
id: book-build
69+
run: |
70+
just build-book
71+
echo "output-path=$(just print-book-dir)" >> $GITHUB_OUTPUT
72+
7273
- name: Generate sitemap
7374
shell: bash
7475
run: |
@@ -92,4 +93,4 @@ runs:
9293
if: ${{ inputs.publish-pages-artifact }}
9394
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
9495
with:
95-
path: ${{ env.ARTIFACT_PATH }}
96+
path: ${{ steps.book-build.outputs.output-path }}

justfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ just_dir := env_var_or_default("JUST_DIR", justfile_directory())
33

44
python := env_var_or_default("PYTHON", "python3")
55
cargo := env_var_or_default("CARGO", "cargo")
6+
mdbook := env_var_or_default("MDBOOK", "mdbook")
67

78
publish_domain := env_var_or_default("PUBLISH_DOMAIN", "component-model.bytecodealliance.org")
89

@@ -14,12 +15,21 @@ book_output_dir := env_var_or_default("BOOK_OUTPUT_DIR", "./component-model/book
1415
@_default:
1516
{{just}} --list
1617

18+
# Print the directory the book was output to
19+
[group('meta')]
20+
@print-book-dir:
21+
echo -n {{book_output_dir}}
22+
23+
# Build the book
24+
[group('build')]
25+
@build-book:
26+
{{mdbook}} build component-model
27+
1728
# Build the sitemap
29+
[group('build')]
1830
@build-sitemap:
1931
{{python}} {{scripts_dir}}/generate_sitemap.py --domain "{{publish_domain}}" --higher-priority "design" --output-path {{sitemap_output_path}}
2032
if [ ! -f "{{book_output_dir}}/index.html" ]; then \
2133
echo "[error] index.html @ [{{book_output_dir}}] is missing. Build or path misconfigured"; \
2234
exit 1; \
2335
fi
24-
25-

0 commit comments

Comments
 (0)