1717 description : Whether to publish artifacts in a new release.
1818 default : false
1919 type : boolean
20+ pull_request :
21+ paths :
22+ - .github/workflows/docs.yaml
2023
2124# This workflow cannot share caches with typst.yaml, because x86_64-unknown-linux-gnu ≠ x86_64-unknown-linux-musl.
2225
@@ -26,12 +29,15 @@ jobs:
2629 runs-on : ubuntu-latest
2730 permissions :
2831 contents : write
29-
32+ env :
33+ INPUT_REF : ${{ github.event_name == 'workflow_dispatch' && inputs.ref || 'main' }}
34+ INPUT_DOCS_BASE : ${{ github.event_name == 'workflow_dispatch' && inputs.docs_base || '/DOCS-BASE/' }}
35+ INPUT_RELEASE : ${{ github.event_name == 'workflow_dispatch' && inputs.release || false }}
3036 steps :
3137 - uses : actions/checkout@v6
3238 with :
3339 repository : typst/typst
34- ref : ${{ github.event.inputs.ref }}
40+ ref : ${{ env.INPUT_REF }}
3541
3642 - uses : actions/checkout@v6
3743 with :
5965
6066 - name : Build docs
6167 run : |
62- cargo run --package typst-docs --release -- --assets-dir assets/ --out-file docs.json --base "${{ github.event.inputs.docs_base }}"
68+ cargo run --package typst-docs --release -- --assets-dir assets/ --out-file docs.json --base "${{ env.INPUT_DOCS_BASE }}"
6369
6470 - name : Prepare to upload
6571 shell : bash
@@ -68,18 +74,19 @@ jobs:
6874 7z a docs-assets.zip assets/
6975
7076 - name : Upload docs.json
71- uses : actions/upload-artifact@v6
77+ uses : actions/upload-artifact@v7
7278 with :
7379 name : docs.json
7480 path : docs.json
81+ archive : true
7582 - name : Upload docs-assets
76- uses : actions/upload-artifact@v6
83+ uses : actions/upload-artifact@v7
7784 with :
78- name : docs-assets
7985 path : docs-assets.zip
86+ archive : false
8087
8188 - uses : softprops/action-gh-release@v2
82- if : ${{ inputs.release }}
89+ if : ${{ env.INPUT_RELEASE == 'true' }}
8390 env :
8491 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8592 with :
9198 docs.json
9299 docs-assets.zip
93100 - name : Report the release
94- if : ${{ inputs.release }}
101+ if : ${{ env.INPUT_RELEASE == 'true' }}
95102 run : |
96103 echo "Please publish the [draft release](https://github.com/typst-community/dev-builds/releases)." >> "$GITHUB_STEP_SUMMARY"
0 commit comments