Skip to content

Commit bf9571a

Browse files
authored
Merge branch 'main' into fix/issue10501
2 parents dfd1e23 + ca05876 commit bf9571a

File tree

1,834 files changed

+238587
-200456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,834 files changed

+238587
-200456
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,29 @@ body:
2929
You can share a Quarto document using the following syntax, _i.e._, using more backticks than you have in your document (usually four ` ```` `).
3030
For example with Quarto CLI >=1.5:
3131
32-
`````md
33-
````qmd
34-
---
35-
title: "Reproducible Quarto Document"
36-
format: html
37-
engine: jupyter
38-
---
39-
40-
This is a reproducible Quarto document using `format: html`.
41-
It is written in Markdown and contains embedded Python code.
42-
When you run the code, it will produce a message.
43-
44-
```{python}
45-
print("Hello, world!")
46-
```
47-
48-
![An image]({{< placeholder 600 400 >}}){#fig-placeholder}
49-
50-
{{< lipsum 1 >}}
51-
52-
A reference to @fig-placeholder.
53-
54-
The end.
55-
````
56-
`````
32+
````qmd
33+
---
34+
title: "Reproducible Quarto Document"
35+
format: html
36+
engine: jupyter
37+
---
38+
39+
This is a reproducible Quarto document using `format: html`.
40+
It is written in Markdown and contains embedded Python code.
41+
When you run the code, it will produce a message.
42+
43+
```{python}
44+
print("Hello, world!")
45+
```
46+
47+
![An image]({{< placeholder 600 400 >}}){#fig-placeholder}
48+
49+
{{< lipsum 1 >}}
50+
51+
A reference to @fig-placeholder.
52+
53+
The end.
54+
````
5755
5856
- type: textarea
5957
attributes:

.github/actions/cache-typst/action.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
name: "Cache Typst package"
1+
name: "Restore any Typst package cache"
22
description: "Configures the caching for Typst packages"
3+
outputs:
4+
cache-hit:
5+
description: "Was a cache found with primary key ?"
6+
value: ${{ steps.cache-typst-restore.outputs.cache-hit }}
7+
cache-primary-key:
8+
description: "Key of the cache to find and save"
9+
value: ${{ steps.cache-typst-restore.outputs.cache-primary-key }}
10+
cache-matched-key:
11+
description: "Key of the cache found and used."
12+
value: ${{ steps.cache-typst-restore.outputs.cache-primary-key }}
13+
cache-path:
14+
description: "where is the packages cache for typst ?"
15+
value: ${{ steps.cache-typst-path.outputs.TYPST_CACHE }}
316

417
runs:
518
using: "composite"
619
steps:
720
- name: Typst Cache path
21+
id: cache-typst-path
822
run: |
923
case $RUNNER_OS in
1024
"Linux")
@@ -21,13 +35,14 @@ runs:
2135
exit 1
2236
;;
2337
esac
38+
echo "TYPST_CACHE=${TYPST_CACHE}" >> $GITHUB_OUTPUT
2439
shell: bash
2540

2641
- name: Cache Typst package folder
27-
uses: actions/cache@v4
42+
id: cache-typst-restore
43+
uses: actions/cache/restore@v4
2844
with:
2945
path: ${{ env.TYPST_CACHE }}
30-
key: ${{ runner.os }}-typst-1-${{ github.run_id }}
46+
key: ${{ runner.os }}-typst-1
3147
restore-keys: |
32-
${{ runner.os }}-typst-1-
33-
save-always: true
48+
${{ runner.os }}-typst-

.github/pull_request_template.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ I have (if applicable):
2424

2525
- [ ] filed a [contributor agreement](https://github.com/quarto-dev/quarto-cli/blob/main/CONTRIBUTING.md).
2626
- [ ] referenced the GitHub issue this PR closes
27-
- [ ] updated the appropriate changelog
27+
- [ ] updated the appropriate changelog in the PR
28+
- [ ] ensured the present test suite passes
29+
- [ ] added new tests
30+
- [ ] created a separate documentation PR in [Quarto's website repo](https://github.com/quarto-dev/quarto-web/) and linked it to this PR

.github/workflows/actions/quarto-dev/action.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,28 @@ runs:
4242
echo "Unexpected package/dist/share path detected: $(quarto --paths)"
4343
Exit 1
4444
}
45-
If ( "$(git status --porcelain)" -ne "" ) {
46-
echo "Uncommitted changes detected:"
47-
git status --porcelain
48-
Exit 1
45+
# check if configure is modifying some files as it should not
46+
$modifiedFiles = git diff --name-only
47+
If ($modifiedFiles -ne "") {
48+
49+
# Convert the list to an array
50+
$modifiedFilesArray = $modifiedFiles -split "`n" | ForEach-Object { $_.Trim() }
51+
52+
If ($modifiedFilesArray -contains "tests/uv.lock") {
53+
Write-Output "::warning::test/uv.lock has been modified."
54+
$modifiedFilesArray = $modifiedFilesArray | Where-Object { $_ -notmatch "uv.lock" }
55+
}
56+
57+
# Count the number of modified files
58+
$modifiedFilesCount = $modifiedFilesArray.Count
59+
60+
If ($modifiedFilesCount -ge 1) {
61+
Write-Output "::error::Uncommitted changes detected."
62+
foreach ($file in $modifiedFilesArray) {
63+
Write-Output $file
64+
}
65+
Exit 1
66+
}
4967
}
5068
5169
- name: Quarto Check
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: "Signing file"
2+
description: "Install and configure the environment to then do the signing of files."
3+
inputs:
4+
paths:
5+
description: "Paths to sign"
6+
required: true
7+
signtools-extra-args:
8+
description: "Additionnal arguments to pass to signtool"
9+
outputs:
10+
cert_path:
11+
description: "certificate path"
12+
value: ${{ steps.setup-cert.outputs.SM_CLIENT_CERT_FILE }}
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Setup for SMCTL authentication
18+
id: setup-cert
19+
shell: pwsh
20+
run: |
21+
Write-Output "::group::Check for required environment variable"
22+
if (-not $env:SM_CLIENT_CERT_FILE_B64) {
23+
Write-Output "::error title=Environment Variable Error::SM_CLIENT_CERT_FILE_B64 is not set"
24+
exit 1
25+
} else {
26+
Write-Output "SM_CLIENT_CERT_FILE_B64 is set correctly"
27+
}
28+
Write-Output "::endgroup::"
29+
Write-Output "::group::Retrieve client certificate for auth"
30+
if (!(Test-Path ".\.build\certificates\codesign.pfx")) {
31+
# Get certificates
32+
New-Item -ItemType Directory -Force -Path .\.build\certificates
33+
Set-Content -Path ".\.build\certificates\codesign.txt" -Value $env:SM_CLIENT_CERT_FILE_B64
34+
& certutil -decode ".\.build\certificates\codesign.txt" ".\.build\certificates\codesign.pfx"
35+
} else {
36+
Write-Output "Certificate already exists"
37+
}
38+
# Configure environment for next step
39+
"SM_CLIENT_CERT_FILE=.\.build\certificates\codesign.pfx" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
40+
Write-Output "::endgroup::"
41+
42+
- name: Install SMCTL
43+
shell: pwsh
44+
run: |
45+
Write-Output "::group::Install smctl if needed"
46+
if (!(Get-Command smctl -ErrorAction SilentlyContinue)) {
47+
curl -o smtools-windows-x64.msi "https://rstudio-buildtools.s3.amazonaws.com/posit-dev/smtools-windows-x64.msi"
48+
msiexec /i smtools-windows-x64.msi /quiet /qn /log smtools-windows-x64.log
49+
"C:/Program Files/DigiCert/DigiCert One Signing Manager Tools" | Out-File -FilePath $env:GITHUB_PATH -Append
50+
Write-Output "SMCTL installed and added on PATH"
51+
} else {
52+
Write-Output "SMCTL already installed and on PATH"
53+
}
54+
Write-Output "::endgroup::"
55+
Write-Output "::group::Add signtools in PATH"
56+
if (!(Get-Command signtool -ErrorAction SilentlyContinue)) {
57+
"C:/Program Files (x86)/Windows Kits/10/App Certification Kit" | Out-File -FilePath $env:GITHUB_PATH -Append
58+
Write-Output "signtool added on PATH"
59+
} else {
60+
Write-Output "signtool already installed and on PATH"
61+
}
62+
Write-Output "::endgroup::"
63+
64+
- name: Sign files with signtool
65+
shell: pwsh
66+
env:
67+
SM_CLIENT_CERT_FILE: ${{ steps.setup-cert.outputs.SM_CLIENT_CERT_FILE }}
68+
run: |
69+
Write-Output "::group::Check for required environment variables"
70+
$requiredEnvVars = @('SM_HOST', 'SM_API_KEY', 'SM_CLIENT_CERT_FILE', 'SM_CLIENT_CERT_PASSWORD', 'CERT_FINGERPRINT')
71+
foreach ($envVar in $requiredEnvVars) {
72+
if (-not $(Get-Item -Path "Env:$envVar" -ErrorAction SilentlyContinue)) {
73+
Write-Output "::error title=Missing environment variable::Environment variable $envVar is not set."
74+
exit 1
75+
}
76+
Write-Output "All env var correctly set."
77+
}
78+
Write-Output "::endgroup::"
79+
Write-Output "::group::Sync certificates"
80+
smctl windows certsync
81+
Write-Output "::endgroup::"
82+
# Sign each file that will be bundled in the installer
83+
$paths = "${{ inputs.paths }}" -split "`n" | ForEach-Object { $_.Trim() } | Where-Object { $_ -ne "" }
84+
foreach ($path in $paths) {
85+
Write-Output "::group::Signing ${path}"
86+
signtool.exe sign /sha1 $env:CERT_FINGERPRINT /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ${{ inputs.signtools-extra-args }} $path
87+
if ($LASTEXITCODE -ne 0) {
88+
Write-Output "::error title=Signing error::Error while signing ${path}"
89+
exit 1
90+
}
91+
signtool.exe verify /v /pa $path
92+
if ($LASTEXITCODE -ne 0) {
93+
Write-Output "::error title=Verify signature error::Error while verifying ${path}"
94+
exit 1
95+
}
96+
Write-Output "::endgroup::"
97+
}

0 commit comments

Comments
 (0)