File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
8086 archive : false
8187
8288 - uses : softprops/action-gh-release@v2
83- if : ${{ inputs.release }}
89+ if : ${{ env.INPUT_RELEASE == 'true' }}
8490 env :
8591 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8692 with :
9298 docs.json
9399 docs-assets.zip
94100 - name : Report the release
95- if : ${{ inputs.release }}
101+ if : ${{ env.INPUT_RELEASE == 'true' }}
96102 run : |
97103 echo "Please publish the [draft release](https://github.com/typst-community/dev-builds/releases)." >> "$GITHUB_STEP_SUMMARY"
You can’t perform that action at this time.
0 commit comments