├── .gitignore ├── examples ├── example-04-render-no-publish.md ├── example-05-non-top-level.md ├── example-06-no-render.md ├── example-07-publish-single-format.md ├── quarto-publish-example-with-uv.yml ├── example-02-freeze.md ├── example-08-publish-to-others-services.md ├── README.md ├── example-03-dependencies.md ├── quarto-publish-example.yml └── example-01-basics.md ├── .github ├── docs │ └── _quarto.yml ├── workflows │ ├── test.yaml │ └── test-publish.yaml └── CODE_OF_CONDUCT.md ├── render ├── README.md └── action.yml ├── setup ├── install-quarto-windows.ps1 ├── README.md └── action.yml ├── README.md ├── publish ├── action.yml └── README.md ├── .claude └── CLAUDE.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # dev tooling 3 | .private-journal/ -------------------------------------------------------------------------------- /examples/example-04-render-no-publish.md: -------------------------------------------------------------------------------- 1 | # Quarto Actions: Render without publishing 2 | 3 | If you need to render your project in a GitHub Action, but will use the output for something besides publishing (or publishing to a service not supported by `quarto publish`), then instead of `publish`, use the `render` action: 4 | 5 | ```yaml 6 | - name: Render Quarto Project 7 | uses: quarto-dev/quarto-actions/render@v2 8 | ``` -------------------------------------------------------------------------------- /.github/docs/_quarto.yml: -------------------------------------------------------------------------------- 1 | project: 2 | type: website 3 | 4 | website: 5 | title: "Quarto Actions" 6 | navbar: 7 | left: 8 | - text: "Setup" 9 | href: setup.qmd 10 | - text: "Render" 11 | href: render.qmd 12 | - text: "Publish" 13 | href: publish.qmd 14 | - text: "Examples" 15 | href: examples.qmd 16 | right: 17 | - icon: github 18 | href: https://github.com/quarto-dev/quarto-actions 19 | -------------------------------------------------------------------------------- /examples/example-05-non-top-level.md: -------------------------------------------------------------------------------- 1 | # Quarto Actions: non-top-level projects 2 | 3 | It's possible to have a quarto project in a large GitHub repository, where the quarto project does not reside at the top-level directory. In this case, add a `path` input to the invocation of the `render` or `publish` action. For example: 4 | 5 | ```yaml 6 | - name: Publish to GitHub Pages (and render) 7 | uses: quarto-dev/quarto-actions/publish@v2 8 | with: 9 | target: gh-pages 10 | path: subdirectory-to-use 11 | ``` -------------------------------------------------------------------------------- /examples/example-06-no-render.md: -------------------------------------------------------------------------------- 1 | # Quarto Actions: Publishing without rendering 2 | 3 | By default, the `quarto-actions/publish@v2` action will re-render your entire project before publishing. 4 | However, if you store the rendered project in version control, you don't need 5 | the GitHub action to re-render the project. In that case, add the option `render: false` 6 | to the `publish` action: 7 | 8 | ```yaml 9 | - name: Publish to GitHub Pages (and render) 10 | uses: quarto-dev/quarto-actions/publish@v2 11 | with: 12 | target: gh-pages 13 | render: false 14 | ``` 15 | -------------------------------------------------------------------------------- /render/README.md: -------------------------------------------------------------------------------- 1 | # Usage 2 | 3 | ```yaml 4 | - name: Render Quarto Project 5 | uses: quarto-dev/quarto-actions/render@v2 6 | with: 7 | to: html # If set, it will be equivalent to `quarto render --to html` 8 | path: source-folder # By default, the current working dir is used i.e `quarto render .` 9 | ``` 10 | 11 | `path:` can be a path to a subdirectory containing the quarto project to be rendered or a path to a single .qmd file 12 | 13 | ## Rendering with a Quarto profile 14 | 15 | You can render with a specific profile by setting the `QUARTO_PROFILE` environment variable. For example, to render with the `preview` profile (i.e. you have a `_quarto-preview.yml` file in your project), you can do: 16 | 17 | ```yaml 18 | - name: Render Quarto Project 19 | uses: quarto-dev/quarto-actions/render@v2 20 | env: 21 | QUARTO_PROFILE: preview 22 | with: 23 | to: html 24 | ``` 25 | -------------------------------------------------------------------------------- /examples/example-07-publish-single-format.md: -------------------------------------------------------------------------------- 1 | # Quarto Actions: Rendering a single format 2 | 3 | With the `publish` action, it is either rendering all format by default, or none with `render: false`. If you need to customize the rendering step, e.g. only render one format in CI before publishing, use a two step process: 4 | 5 | * use the `quarto-actions/render@v2` action and provide a target output format (in this example YAML configuration, we use the HTML format) 6 | * use the `quarto-actions/publish@v2` action with `render: false` to skip rendering before publishing (in this example YAML configuration, we publish to GitHub Pages) 7 | 8 | ```yaml 9 | - name: Render Book project 10 | uses: quarto-dev/quarto-actions/render@v2 11 | with: 12 | to: html 13 | 14 | - name: Publish HTML book 15 | uses: quarto-dev/quarto-actions/publish@v2 16 | with: 17 | target: gh-pages 18 | render: false 19 | ``` 20 | -------------------------------------------------------------------------------- /examples/quarto-publish-example-with-uv.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_dispatch: 3 | push: 4 | branches: main 5 | 6 | name: Quarto Publish 7 | 8 | jobs: 9 | build-deploy: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | contents: write 13 | steps: 14 | - name: Check out repository 15 | uses: actions/checkout@v4 16 | - name: Install uv 17 | uses: astral-sh/setup-uv@v6 18 | with: 19 | enable-cache: true 20 | - name: Install the project 21 | run: uv sync --locked --all-extras --dev 22 | - name: Add venv to PATH 23 | run: echo "$(pwd)/.venv/bin" >> $GITHUB_PATH 24 | - name: Set up Quarto 25 | uses: quarto-dev/quarto-actions/setup@v2 26 | - name: Render and Publish 27 | uses: quarto-dev/quarto-actions/publish@v2 28 | with: 29 | target: gh-pages 30 | env: 31 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 32 | -------------------------------------------------------------------------------- /examples/example-02-freeze.md: -------------------------------------------------------------------------------- 1 | # Quarto Actions: Freeze 2 | 3 | If you have computational content which cannot be executed in a CI environment (because of eg security or authentication), you can use Quarto's freezer feature. 4 | 5 | ## Enabling Freeze 6 | 7 | Add the following to your `_quarto.yml` configuration: 8 | 9 | ```yaml 10 | execute: 11 | freeze: true # never re-execute computational content during project render 12 | ``` 13 | 14 | This stops quarto from re-executing computational cells during a project render. 15 | 16 | ## Adding the frozen contents to the repository 17 | 18 | From a computer that is capable of executing the content, run a file-specific `render` command to create or update the frozen content 19 | 20 | ```bash 21 | $ quarto render name-of-file-to-freeze.qmd 22 | ``` 23 | 24 | Note that you have to specify the particular file: a call to `quarto render` will _not_ re-execute the content when `freeze: true`. Finally, add the `_freeze` top-level directory to version control so that GitHub Actions can reuse the executed content. 25 | 26 | ## More 27 | 28 | See [Quarto's documentation on freeze](https://quarto.org/docs/projects/code-execution.html#freeze) for more. -------------------------------------------------------------------------------- /setup/install-quarto-windows.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | Install Quarto release through Scoop package manager 4 | .Description 5 | Install Scoop then add r-bucket, and install Quarto from there. 6 | .Example 7 | install-quarto-windows.ps1 8 | .Notes 9 | On Windows, it may be required to enable this Activate.ps1 script by setting the 10 | execution policy for the user. You can do this by issuing the following PowerShell 11 | command: 12 | PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser 13 | For more information on Execution Policies: 14 | ttps:/go.microsoft.com/fwlink/?LinkID=135170 15 | #> 16 | 17 | # Exit immediately on errors 18 | $ErrorActionPreference = "Stop" 19 | 20 | try { 21 | Invoke-WebRequest -useb get.scoop.sh -outfile 'install.ps1' 22 | .\install.ps1 -RunAsAdmin 23 | if ($LASTEXITCODE -ne 0) { 24 | Write-Error "Scoop installation failed with exit code $LASTEXITCODE" 25 | exit 1 26 | } 27 | $scoopShims = Join-Path (Resolve-Path ~).Path "scoop\shims" 28 | Add-Content -Path $Env:GITHUB_PATH -Value $scoopShims 29 | } catch { 30 | Write-Error "Failed to download or install Scoop: $_" 31 | exit 1 32 | } 33 | 34 | $version=$args[0] 35 | scoop bucket add r-bucket https://github.com/cderv/r-bucket.git 36 | 37 | if ([string]::IsNullOrEmpty($version)) { 38 | scoop install quarto 39 | } elseif ($version -eq 'pre-release') { 40 | scoop install quarto-prerelease 41 | } else { 42 | scoop install quarto@$version 43 | } 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Github Actions for Quarto 2 | 3 | This repository stores [Github Actions](https://github.com/features/actions) useful for building and publishing [Quarto](https://quarto.org/) documents. 4 | 5 | 1. [quarto-dev/quarto-actions/setup](./setup) - Install Quarto 6 | 2. [quarto-dev/quarto-actions/render](./render) - Render project 7 | 3. [quarto-dev/quarto-actions/publish](./publish) - Publish project 8 | 9 | We recommend using `v2` for your actions, and our examples all use `v2`. 10 | 11 | ## Examples 12 | 13 | In [Examples](./examples), you will find a YAML workflow file to serve as a template to be reused as a base for your project. We are also sharing some links to real example Github repositories using Quarto with Github Actions for rendering and deploying documents and projects. If you want to add your repository in the list, we welcome a PR. 14 | 15 | ## Release Management 16 | 17 | This repository uses [GitHub's recommended release management for actions](https://docs.github.com/en/actions/creating-actions/about-custom-actions#using-release-management-for-actions): 18 | 19 | * GitHub releases with tags are used for updates on the actions. 20 | * Semantic versioning is used, with major, minor and possibly patch release. 21 | * Major versions (such as `v1`) will always point to the last minor or patch release for this major version. (when `v1.0.2` is out, `v1` will point to this update, too). This means using `quarto-dev/quarto-actions/setup@v2` in your workflow file will automatically get the updated versions. Using `quarto-dev/quarto-actions/setup@v1.0.2` will pin a specific release. 22 | * Major version changes (`v1` to `v2`) will often come with breaking changes, and workflows might require manual updates. -------------------------------------------------------------------------------- /render/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Render Quarto project' 2 | author: 'Carlos Scheidegger' 3 | description: 'This action will render an existing quarto project' 4 | inputs: 5 | to: 6 | description: 'Format to render output. Use "all" to generate all outputs, when eg rendering a book in HTML and PDF' 7 | required: false 8 | path: 9 | description: 'Subdirectory containing the quarto project to be rendered' 10 | required: false 11 | default: "." 12 | runs: 13 | using: 'composite' 14 | steps: 15 | # Chrome v128 started to create problem. Pin previous version in the meantime 16 | # - name: Install Chrome 17 | # uses: browser-actions/setup-chrome@v1 18 | # with: 19 | # chrome-version: 127 20 | # The Check Chromium step appears necessary to avoid a crash/hang when rendering PDFs 21 | # https://github.com/quarto-dev/quarto-actions/issues/45#issuecomment-1562599451 22 | # 23 | # chromium is installed in the ubuntu 21 runners in GHA, so no need to install it 24 | #- name: 'Check Chromium' 25 | # if: ${{ runner.os == 'Linux' }} 26 | # run: | 27 | # echo $(which google-chrome) 28 | # $(which google-chrome) --headless --no-sandbox --disable-gpu --renderer-process-limit=1 https://www.chromestatus.com 29 | # shell: bash 30 | - name: 'Render' 31 | env: 32 | QUARTO_PRINT_STACK: true 33 | run: | 34 | if [ "${{ inputs.to }}" == "" ]; then 35 | quarto render ${{ inputs.path }} 36 | else 37 | quarto render ${{ inputs.path }} --to ${{ inputs.to }} 38 | fi 39 | if [ -f "_book" ]; then 40 | echo "QUARTO_OUTPUT=_book" >> $GITHUB_ENV 41 | elif [ -f "_site" ]; then 42 | echo "QUARTO_OUTPUT=_site" >> $GITHUB_ENV 43 | fi 44 | shell: bash 45 | -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: test.yaml 2 | 3 | permissions: read-all 4 | 5 | on: 6 | push: 7 | branches: [main, master] 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' # Weekly on Sunday at midnight UTC 11 | workflow_dispatch: 12 | inputs: 13 | version: 14 | description: | 15 | Quarto version, may be "release", "pre-release" or a version number. 16 | required: true 17 | default: 'release' 18 | type: string 19 | tinytex: 20 | description: 'If true, install TinyTex, required for PDF rendering' 21 | required: false 22 | default: 'false' 23 | 24 | jobs: 25 | quarto-setup: 26 | runs-on: ${{ matrix.config.os }} 27 | name: ${{ matrix.config.os }} (${{ inputs.version || matrix.version }}) 28 | 29 | strategy: 30 | fail-fast: false 31 | matrix: 32 | version: ${{ inputs.version && fromJSON(format('["{0}"]', inputs.version)) || fromJSON('["release", "pre-release", "1.8.25"]') }} 33 | config: 34 | # Default config for standard platforms 35 | - os: macos-latest 36 | - os: macos-15-intel 37 | - os: windows-latest 38 | tinytex: 'false' 39 | - os: ubuntu-latest 40 | # Special config for ARM 41 | - os: ubuntu-22.04-arm 42 | tinytex: 'false' 43 | 44 | steps: 45 | - uses: actions/checkout@v6 46 | 47 | - uses: ./setup 48 | env: 49 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 50 | with: 51 | version: ${{ matrix.version }} 52 | tinytex: ${{ inputs.tinytex || matrix.config.tinytex || 'true' }} 53 | 54 | - run: quarto --version 55 | 56 | - run: which quarto 57 | if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} 58 | 59 | - run: where.exe quarto 60 | if: ${{ runner.os == 'Windows' }} 61 | 62 | -------------------------------------------------------------------------------- /examples/example-08-publish-to-others-services.md: -------------------------------------------------------------------------------- 1 | # Quarto Actions: Publishing to others services not supported by `quarto publish` 2 | 3 | With the `publish` action, you can publish to [any supported destinations](https://quarto.org/docs/publishing/ci.html#publishing-credentials). If you need to publish to another service, the following can be done: 4 | 5 | * use the `quarto-actions/render` action to render the project on CI (usually to a `_book` or `_site` directory, or any other name you used) 6 | * use a custom Github action step to publish the rendered project to the service of your choice. 7 | 8 | The custom step could be using a CLI tool you have installed, or another Github action from the Github marketplace. 9 | 10 | Below is an example to publish to Cloudfare Pages, using their Github action [`cloudflare/pages-action`](https://github.com/marketplace/actions/cloudflare-pages-github-action). 11 | 12 | ```yaml 13 | on: 14 | workflow_dispatch: 15 | push: 16 | branches: main 17 | 18 | name: Quarto Publish to Cloudfare Pages 19 | 20 | jobs: 21 | build-deploy: 22 | runs-on: ubuntu-latest 23 | permissions: 24 | contents: write 25 | deployments: write # needed for Cloudflare 26 | steps: 27 | - name: Check out repository 28 | uses: actions/checkout@v4 29 | 30 | - name: Set up Quarto 31 | uses: quarto-dev/quarto-actions/setup@v2 32 | with: 33 | tinytex: true 34 | 35 | - name: Render Quarto Project 36 | uses: quarto-dev/quarto-actions/render@v2 37 | 38 | - name: Publish 39 | uses: cloudflare/pages-action@v1 40 | with: 41 | apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} 42 | accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} 43 | projectName: #cloudflare-project-id 44 | directory: '_book' # or _site or any other directory you used as project's output-dir in `_quarto.yml` 45 | gitHubToken: ${{ secrets.GITHUB_TOKEN }} 46 | ``` 47 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Using Quarto Actions: Examples 2 | 3 | * [Basics](./example-01-basics.md) 4 | * [Freeze](./example-02-freeze.md) 5 | * [Dependencies](./example-03-dependencies.md) 6 | * [Render with no publish](./example-04-render-no-publish.md) 7 | * [Rendering and publishing a non-top-level project](./example-05-non-top-level.md) 8 | * [Publishing a single format, publishing without rendering](./example-06-no-render.md) 9 | * [Publishing a single format](./example-07-publish-single-format.md) 10 | * [Publishing to other services](./example-08-publish-to-others-services.md) 11 | 12 | ## Repositories using Quarto actions 13 | 14 | - [Earthdata Cloud Cookbook](https://nasa-openscapes.github.io/earthdata-cloud-cookbook/) ([source](https://github.com/NASA-Openscapes/earthdata-cloud-cookbook), [workflow file](https://github.com/NASA-Openscapes/earthdata-cloud-cookbook/blob/main/.github/workflows/quarto-publish.yml)) This book contains `.md` and `.ipynb` files, and is built with Quarto and Python in GHA, and deployed to Github Pages. 15 | 16 | - [R Manuals Quarto website](https://rstudio.github.io/r-manuals/) ([source](https://github.com/rstudio/r-manuals), [workflow file](https://github.com/rstudio/r-manuals/blob/main/.github/workflows/build-website.yaml)) This project uses a workflow to build several books with R and Quarto and organizes them in a website deployed to Github pages. 17 | 18 | - [Pathology Atlas](https://www.patolojiatlasi.com/EN) ([source](https://github.com/patolojiatlasi/patolojiatlasi.github.io), [workflow file](https://github.com/patolojiatlasi/patolojiatlasi.github.io/blob/main/.github/workflows/Quarto-Render-Bilingual-Book-Push-Other-Repos-GitLab.yml)) This multilingual website is rendered in two versions and deployed using Github Actions. 19 | 20 | ## FAQ 21 | 22 | * My project uses git lfs storage; how should I adapt the action? 23 | 24 | If your project uses git lfs storage, you must opt-in to git lfs during the `checkout` step. 25 | 26 | ```yaml 27 | - name: Check out repository 28 | uses: actions/checkout@v4 29 | with: 30 | lfs: true # needed when using lfs for image storage 31 | ``` 32 | 33 | See the [checkout action documentation](https://github.com/actions/checkout) for details. 34 | -------------------------------------------------------------------------------- /examples/example-03-dependencies.md: -------------------------------------------------------------------------------- 1 | # Quarto Actions: Dependencies 2 | 3 | If you want to execute computational content in GitHub Actions workflows, you are going to have to install the necessary software dependencies in your action. 4 | 5 | ## Installing R 6 | 7 | Add the following entry to your GitHub Actions workflow: 8 | 9 | ```yaml 10 | - uses: r-lib/actions/setup-r@v2 11 | with: 12 | r-version: '4.2.0' # The R version to download (if necessary) and use. 13 | ``` 14 | 15 | If you're using `quarto-publish-example.yml`, add those right after the `# add software dependencies here` comment. 16 | 17 | ### Using **renv** to manage R packages 18 | 19 | If you are managing your R package dependencies with `renv`, the following action will install the dependencies: 20 | 21 | ```yaml 22 | - uses: r-lib/actions/setup-renv@v2 23 | with: 24 | cache-version: 1 25 | ``` 26 | 27 | See [the `setup-renv` documentation](https://github.com/r-lib/actions/tree/v2/setup-renv) for how to use `cache-version`. 28 | See [the `renv` documentation](https://rstudio.github.io/renv) for how to use **renv** with a project. 29 | 30 | ### Installing R packages manually 31 | 32 | You can also use `r-lib/actions/setup-r-dependencies@v2` to install required R packages for your content. See more about 33 | this actions at [the `setup-r-dependencies` documentation](https://github.com/r-lib/actions/tree/v2-branch/setup-r-dependencies). 34 | It can handle dependencies with a `DESCRIPTION` in your project, or you can also list manually what is needed. e.g 35 | 36 | ```yaml 37 | - uses: r-lib/actions/setup-r-dependencies@v2 38 | with: 39 | packages: 40 | any::knitr 41 | any::rmarkdown 42 | any::downlit 43 | any::xml2 44 | ``` 45 | 46 | ## Installing Jupyter 47 | 48 | Add the following entry to your GitHub Actions workflow: 49 | 50 | ```yaml 51 | - uses: actions/setup-python@v4 52 | with: 53 | python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax 54 | - run: pip install jupyter 55 | ``` 56 | 57 | ### Using `requirements.txt` 58 | 59 | ```yaml 60 | - uses: actions/setup-python@v4 61 | with: 62 | python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax 63 | cache: 'pip' 64 | - run: pip install jupyter # (if jupyter is not part of your requirements.txt) 65 | - run: pip install -r requirements.txt 66 | ``` 67 | 68 | ## Installing Julia 69 | 70 | ```yaml 71 | - uses: julia-actions/setup-julia@v1 72 | - run: julia --project -e 'using Pkg; Pkg.instantiate()' 73 | ``` 74 | -------------------------------------------------------------------------------- /examples/quarto-publish-example.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | 6 | name: Render and Publish 7 | 8 | # you need these permissions to publish to GitHub pages 9 | # permissions: 10 | # contents: write 11 | # pages: write 12 | 13 | jobs: 14 | build-deploy: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Check out repository 19 | uses: actions/checkout@v4 20 | 21 | - name: Set up Quarto 22 | uses: quarto-dev/quarto-actions/setup@v2 23 | env: 24 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | with: 26 | # To install LaTeX to build PDF book 27 | tinytex: true 28 | # uncomment below and fill to pin a version 29 | # version: SPECIFIC-QUARTO-VERSION-HERE 30 | 31 | # add software dependencies here and any libraries 32 | 33 | # From https://github.com/actions/setup-python 34 | # - name: Setup Python 35 | # uses: actions/setup-python@v3 36 | 37 | # From https://github.com/r-lib/actions/tree/v2-branch/setup-r 38 | # - name: Setup R 39 | # uses: r-lib/actions/setup-r@v2 40 | 41 | # From https://github.com/julia-actions/setup-julia 42 | # - name: Setup Julia 43 | # uses: julia-actions/setup-julia@v1 44 | 45 | # See more at https://github.com/quarto-dev/quarto-actions/blob/main/examples/example-03-dependencies.md 46 | 47 | # To publish to Netlify, RStudio Connect, or GitHub Pages, uncomment 48 | # the appropriate block below 49 | 50 | # - name: Publish to Netlify (and render) 51 | # uses: quarto-dev/quarto-actions/publish@v2 52 | # with: 53 | # target: netlify 54 | # NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} 55 | 56 | # - name: Publish to RStudio Connect (and render) 57 | # uses: quarto-dev/quarto-actions/publish@v2 58 | # with: 59 | # target: connect 60 | # CONNECT_SERVER: enter-the-server-url-here 61 | # CONNECT_API_KEY: ${{ secrets.CONNECT_API_KEY }} 62 | 63 | # NOTE: If Publishing to GitHub Pages, set the permissions correctly (see top of this yaml) 64 | # - name: Publish to GitHub Pages (and render) 65 | # uses: quarto-dev/quarto-actions/publish@v2 66 | # with: 67 | # target: gh-pages 68 | # env: 69 | # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # this secret is always available for github actions 70 | 71 | # - name: Publish to confluence 72 | # uses: quarto-dev/quarto-actions/publish@v2 73 | # with: 74 | # target: confluence 75 | # env: 76 | # CONFLUENCE_USER_EMAIL: ${{ secrets.CONFLUENCE_USER_EMAIL }} 77 | # CONFLUENCE_AUTH_TOKEN: ${{ secrets.CONFLUENCE_AUTH_TOKEN }} 78 | # CONFLUENCE_DOMAIN: ${{ secrets.CONFLUENCE_DOMAIN }} 79 | 80 | -------------------------------------------------------------------------------- /publish/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Publish Quarto project' 2 | author: 'Carlos Scheidegger' 3 | description: 'This action will publish an existing quarto project' 4 | inputs: 5 | to: 6 | description: 'Service to publish to. If unspecified, use the default value derived from _publish.yml' 7 | required: false 8 | target: 9 | description: 'Alias for `to`. If unspecified, use the default value derived from _publish.yml' 10 | required: false 11 | CONNECT_SERVER: 12 | description: 'RStudio Connect server. If unspecified, use the default value derived from _publish.yml' 13 | required: false 14 | CONNECT_API_KEY: 15 | description: 'RStudio Connect API key. (Use with github actions secrets: see documentation and examples for details)' 16 | required: false 17 | NETLIFY_AUTH_TOKEN: 18 | description: 'Netlify Auth Token. (Use with github actions secrets: see documentation and examples for details)' 19 | required: false 20 | QUARTO_PUB_AUTH_TOKEN: 21 | description: 'Quarto Pub Auth Token. (Use with github actions secrets: see documentation and examples for details)' 22 | required: false 23 | GITHUB_EMAIL: 24 | description: 'Email to be used on gh-pages commit' 25 | required: false 26 | default: quarto-github-actions-publish@example.com 27 | GITHUB_USERNAME: 28 | description: 'User name to be used on gh-pages commit' 29 | required: false 30 | default: Quarto GHA Workflow Runner 31 | path: 32 | description: 'Subdirectory containing the quarto project to be published' 33 | required: false 34 | default: "." 35 | render: 36 | description: 'If not true, do not render project before publishing' 37 | required: false 38 | default: "true" 39 | runs: 40 | using: 'composite' 41 | steps: 42 | - name: 'Publish' 43 | shell: bash 44 | env: 45 | QUARTO_PRINT_STACK: true 46 | CONNECT_SERVER: ${{ inputs.CONNECT_SERVER }} 47 | CONNECT_API_KEY: ${{ inputs.CONNECT_API_KEY }} 48 | NETLIFY_AUTH_TOKEN: ${{ inputs.NETLIFY_AUTH_TOKEN }} 49 | QUARTO_PUB_AUTH_TOKEN: ${{ inputs.QUARTO_PUB_AUTH_TOKEN }} 50 | run: | 51 | git config --global user.email "${{ inputs.GITHUB_EMAIL }}" 52 | git config --global user.name "${{ inputs.GITHUB_USERNAME }}" 53 | # Propagate git credentials to worktrees (required for actions/checkout@v6) 54 | # See: https://github.com/quarto-dev/quarto-actions/issues/133 55 | if git config get includeIf.gitdir:"$(git rev-parse --path-format=absolute --git-dir)".path &>/dev/null; then 56 | GIT_DIR=$(git rev-parse --path-format=absolute --git-dir) 57 | CRED_PATH=$(git config get --path includeIf.gitdir:"${GIT_DIR}".path) 58 | git config set --path includeIf.gitdir:"${GIT_DIR}/worktrees/*".path "${CRED_PATH}" 59 | fi 60 | TARGET="${{ inputs.to }}" 61 | if [ "$TARGET" == "" ]; then 62 | TARGET="${{ inputs.target }}" 63 | fi 64 | if [ "${{ inputs.render }}" != "true" ]; then 65 | quarto publish $TARGET ${{ inputs.path }} --no-render --no-browser 66 | else 67 | quarto publish $TARGET ${{ inputs.path }} --no-browser 68 | fi 69 | -------------------------------------------------------------------------------- /setup/README.md: -------------------------------------------------------------------------------- 1 | # setup 2 | 3 | Setup a Quarto release (https://github.com/quarto-dev/quarto-cli/releases) using GitHub Actions. This action can be used to install Quarto on all runner OSs, so that `quarto` will be available from the path. 4 | 5 | ## Usage 6 | 7 | This action will: 8 | 9 | * On macOS and Linux: 10 | - Download a release of Quarto from GitHub and install it 11 | - use `gh` to download the latest available bundle, if no `version` is specified as input. If `gh` is not available on your Github Action runner, you can specify a fixed `version` which will be directly downloaded using `wget`. 12 | - Install TinyTeX if requested. 13 | * On Windows: 14 | - Use **Scoop** (https://github.com/ScoopInstaller/Scoop) to install Quarto, as we have still an issue with Quarto MSI on Github Action (https://github.com/quarto-dev/quarto-cli/issues/108). The action will also install **Scoop** on the runner. 15 | 16 | We recommend using a Linux or MacOS runner if possible, especially if TinyTeX is needed. 17 | 18 | ### Inputs available 19 | 20 | * `version` - _optional_. If provided, the specific quarto version will be installed. Ex: `version: 1.4.515` 21 | 22 | ```yaml 23 | steps: 24 | - uses: quarto-dev/quarto-actions/setup@v2 25 | with: 26 | version: 1.4.515 27 | ``` 28 | 29 | If not provided, `setup` will use the latest _released_ version of quarto. 30 | 31 | If the latest `pre-release` build is desired, use `version: pre-release`. 32 | 33 | * `tinytex` - _optional_. Set `tinytex: true` to [install TinyTeX](https://quarto.org/docs/output-formats/pdf-engine.html#installing-tex) using `quarto install tool tinytex`. Note: Installing TinyTeX on Windows can take several minutes. 34 | 35 | ```yaml 36 | steps: 37 | - uses: quarto-dev/quarto-actions/setup@v2 38 | env: 39 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 40 | with: 41 | tinytex: true 42 | ``` 43 | 44 | Setting `GH_TOKEN` is recommended as installing TinyTeX will query the github API. Otherwise, some API rate limit issue could happen which will make the step fails (e.g. with an explicit 403 - Forbidden error). A re-run of failed job on Github would solve it too. 45 | 46 | ### GitHub Enterprise 47 | 48 | For GitHub Enterprise Server (GHES), you may need to [generate a personal access token (PAT) on github.com](https://github.com/settings/tokens/new) to enable downloading Quarto. GitHub's [setup-python action](https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#avoiding-rate-limit-issues) uses a similar workaround, from which these instructions are adapted: 49 | 50 | - Create a PAT on any github.com account by using [this link](https://github.com/settings/tokens/new) after logging into github.com (not your GHES instance). This PAT does not need any rights, so make sure all the boxes are unchecked. 51 | - Store this PAT in the repository / organization where you run your workflow, e.g. as `GH_GITHUB_COM_TOKEN`. You can do this by navigating to your repository -> **Settings** -> **Secrets** -> **Actions** -> **New repository secret**. 52 | - In your workflow, incorporate your PAT as an environment variable. For example: 53 | 54 | ```yaml 55 | - name: Set up Quarto 56 | uses: quarto-dev/quarto-actions/setup@v2 57 | env: 58 | GH_TOKEN: ${{ secrets.GH_GITHUB_COM_TOKEN }} 59 | ``` 60 | 61 | ## Examples 62 | 63 | ```yaml 64 | name: quarto-setup 65 | 66 | on: 67 | branch: main 68 | 69 | jobs: 70 | quarto-linux: 71 | runs-on: ubuntu-latest 72 | steps: 73 | - uses: quarto-dev/quarto-actions/setup@v2 74 | - run: | 75 | quarto --version 76 | quarto-windows: 77 | runs-on: windows-latest 78 | steps: 79 | - uses: quarto-dev/quarto-actions/setup@v2 80 | - run: | 81 | quarto --version 82 | quarto-macos: 83 | runs-on: macos-latest 84 | steps: 85 | - uses: quarto-dev/quarto-actions/setup@v2 86 | - run: | 87 | quarto --version 88 | ``` 89 | 90 | -------------------------------------------------------------------------------- /.claude/CLAUDE.md: -------------------------------------------------------------------------------- 1 | # CLAUDE.md 2 | 3 | This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. 4 | 5 | ## Project Overview 6 | 7 | This repository provides three GitHub Actions for working with Quarto: 8 | 9 | 1. **setup** - Installs Quarto on GitHub Actions runners 10 | 2. **render** - Renders a Quarto project 11 | 3. **publish** - Publishes a Quarto project to various services 12 | 13 | The actions are implemented as composite actions (using shell scripts) rather than JavaScript or Docker container actions. 14 | 15 | ## Architecture 16 | 17 | ### Action Structure 18 | 19 | Each action lives in its own directory with: 20 | - `action.yml` - Action definition with inputs/outputs 21 | - `README.md` - User-facing documentation 22 | - Supporting scripts (e.g., `install-quarto-windows.ps1` for setup action) 23 | 24 | All actions use `using: 'composite'` with shell steps, making them OS-agnostic. 25 | 26 | ### Platform-Specific Installation (setup action) 27 | 28 | The setup action handles three platforms differently: 29 | 30 | - **Linux**: Downloads `.deb` file (AMD64 or ARM64), installs with `apt` 31 | - **macOS**: Downloads `.pkg` file, installs with `installer` 32 | - **Windows**: Uses Scoop package manager via `install-quarto-windows.ps1` (workaround because MSI installation doesn't work in GitHub Actions) 33 | 34 | Version handling: 35 | - `"release"` (default) - Fetches latest stable from `quarto.org/docs/download/_download.json` 36 | - `"pre-release"` - Fetches latest dev from `quarto.org/docs/download/_prerelease.json` 37 | - Specific version (e.g., `"1.3.450"`) - Downloads that exact release 38 | 39 | ### Quarto Binary Detection 40 | 41 | The setup action determines the correct binary based on `$RUNNER_OS` and `$RUNNER_ARCH`, setting `BUNDLE_EXT` environment variable to one of: 42 | - `linux-amd64.deb` 43 | - `linux-arm64.deb` 44 | - `macos.pkg` 45 | - `win.msi` 46 | 47 | ### Render and Publish Actions 48 | 49 | Both actions: 50 | - Accept a `path` input for subdirectory rendering/publishing 51 | - Set `QUARTO_PRINT_STACK: true` for better debugging 52 | - Use bash shells exclusively (even on Windows, leveraging Git Bash) 53 | 54 | The publish action: 55 | - Configures git identity for gh-pages commits 56 | - Handles multiple publishing targets (gh-pages, Netlify, Quarto Pub, RStudio Connect) 57 | - Supports `--no-render` flag to skip rendering before publishing 58 | - Has both `to` and `target` inputs (aliases) for backward compatibility 59 | 60 | ## Testing 61 | 62 | Run tests with: 63 | ```bash 64 | gh workflow run test.yaml 65 | ``` 66 | 67 | The test workflow (`.github/workflows/test.yaml`): 68 | - Tests on multiple OS/architecture combinations (macOS, Windows, Ubuntu AMD64, Ubuntu ARM) 69 | - Matrix tests both `release` and `pre-release` versions by default 70 | - Supports manual dispatch to test specific versions or enable TinyTeX 71 | - Uses `uses: ./setup` to test the action directly from the working tree 72 | 73 | ## Version Management 74 | 75 | This repository follows GitHub's recommended release management: 76 | - Major versions (`v2`, `v1`) are moving tags that point to latest minor/patch 77 | - Specific versions (`v2.0.1`) are immutable 78 | - Users should use `quarto-dev/quarto-actions/setup@v2` for automatic updates 79 | - Breaking changes only come with major version bumps 80 | 81 | ## Windows-Specific Considerations 82 | 83 | Windows installation uses Scoop because MSI installation doesn't work reliably in GitHub Actions. The `install-quarto-windows.ps1` script: 84 | - Installs Scoop if not present 85 | - Adds the `r-bucket` (maintained by Chris at github.com/cderv/r-bucket.git) 86 | - Installs Quarto or specific versions through Scoop 87 | - Adds Scoop shims to `$GITHUB_PATH` 88 | 89 | ## Common Issues 90 | 91 | - **TinyTeX PATH**: After installing TinyTeX, the action adds its binary directory to `$GITHUB_PATH` differently per platform (Linux: `$HOME/bin`, macOS: finds via `~/Library/TinyTeX`, Windows: finds via `$APPDATA/TinyTeX`) 92 | - **Chromium crashes**: Past issues with Chromium when rendering PDFs (see commented-out Chrome installation steps in render action) 93 | - **Output directory detection**: Render action attempts to detect `_book` or `_site` output directories 94 | -------------------------------------------------------------------------------- /examples/example-01-basics.md: -------------------------------------------------------------------------------- 1 | # Quarto Actions: Basics 2 | 3 | The simplest workflow using Quarto Actions uses the `setup` and `publish` actions: [quarto-publish-example.yml](quarto-publish-example.yml). 4 | 5 | ## GitHub Pages 6 | 7 | 1. **Add the GitHub Actions workflow to your project** 8 | 9 | Copy [quarto-publish-example.yml](quarto-publish-example.yml) to `.github/workflows/quarto-publish.yml`. Uncomment the "Publish to GitHub Pages (and render)" action. Do *not* edit the line below to add a secret to this file. Also uncomment the minimum required access permissions; a general change in your repository's settings for GitHub actions permissions is **not needed**. 10 | 11 | 2. **run `quarto publish gh-pages` locally, once** 12 | 13 | Quarto needs to configure the repository for publishing through GitHub Actions. To do this, run `quarto publish gh-pages` locally once. 14 | 15 | Now, add and commit the workflow file you have just created, and push the result to GitHub. This should trigger a new action from GitHub that will automatically render and publish your website through GitHub pages. 16 | 17 | Note that GitHub Pages uses a `gh-pages` branch in your repository, which will be automatically created if one doesn't exist. 18 | 19 | ## Netlify 20 | 21 | 1. **Create Netlify auth token** 22 | 23 | Go to Netlify's [applications page](https://app.netlify.com/user/applications), and click on "New Access Token" to create a new personal access token. Give this token a memorable name, and note the resulting string (or keep this browser window open). 24 | 25 | 2. **Add Netlify auth token to your GitHub repository** 26 | 27 | Go to the GitHub webpage for the repository that will be using this GitHub Action. Click on "Settings". On the new page, click on "Secrets", then on the dropdown "Actions". Now, on the right-hand tab, click on the "New repository secret" button to the right of the title "Actions secrets". For the "Name" field, use `NETLIFY_AUTH_TOKEN`, and for the "Value" field, paste the string you got from step 1. 28 | 29 | 3. **Add the GitHub Actions workflow to your project** 30 | 31 | Copy [quarto-publish-example.yml](quarto-publish-example.yml) to `.github/workflows/quarto-publish.yml`. 32 | 33 | Uncomment the "Publish to Netlify (and render)" action. No further changes are needed (in particular, do *not* edit the line below to add a secret to this file. This file has the same permissions as your repository, and might be publicly readable) 34 | 35 | 4. **Add `_publish.yml` to your repository** 36 | 37 | Quarto stores publishing metadata information in `_publish.yml`. To create this file, run `quarto publish netlify` locally once. 38 | 39 | 40 | Finally, add and commit the files you have just created, and push the result to GitHub. This should trigger a new action from GitHub that will automatically render and publish your website through Netlify. 41 | 42 | ## RStudio Connect 43 | 44 | 1. **Create RStudio Connect auth token** 45 | 46 | After logging in to your RStudio Connect server, click on your username on the top right. A sidebar should slide in from the right. Click on "API keys". On the new page, click on the "New API Key" button. Give it a memorable name and note the resulting string (or keep this browser window open). 47 | 48 | 2. **Add RStudio Connect auth token to your GitHub repository** 49 | 50 | Go to the GitHub webpage for the repository that will be using this GitHub Action. Click on "Settings". On the new page, click on "Secrets", then on the dropdown "Actions". Now, on the right-hand tab, click on the "New repository secret" button to the right of the title "Actions secrets". For the "Name" field, use `CONNECT_API_KEY`, and for the "Value" field, paste the string you got from step 1. 51 | 52 | 3. **Add the GitHub Actions workflow to your project** 53 | 54 | Copy [quarto-publish-example.yml](quarto-publish-example.yml) to `.github/workflows/quarto-publish.yml`. Uncomment the "Publish to RStudio Connect (and render)" action, and change the CONNECT_SERVER entry to the URL of your RStudio Connect server. No further changes are needed to the action (in particular, do *not* edit the line below to add a secret to this file. This file has the same permissions as your repository, and might be publicly readable) 55 | 56 | 4. **Add `_publish.yml` to your repository** 57 | 58 | Quarto stores publishing metadata information in `_publish.yml`. To create this file, run `quarto publish connect` locally once. 59 | 60 | Finally, add and commit the files you have just created, and push the result to GitHub. This should trigger a new action from GitHub that will automatically render and publish your website through RStudio Connect. 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /.github/workflows/test-publish.yaml: -------------------------------------------------------------------------------- 1 | name: Test Publish Action 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | schedule: 7 | - cron: '0 0 * * 1' # Weekly on Monday at midnight UTC 8 | workflow_dispatch: 9 | 10 | permissions: 11 | contents: write 12 | 13 | jobs: 14 | test-publish: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v6 18 | 19 | - uses: ./setup 20 | with: 21 | version: release 22 | 23 | - name: Install yq 24 | run: | 25 | wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq 26 | chmod +x /usr/local/bin/yq 27 | 28 | # Generate website content from README files 29 | - name: Generate Quarto site 30 | run: | 31 | # Create working directory structure 32 | mkdir -p _site_source/examples 33 | 34 | # Copy base Quarto config 35 | cp .github/docs/_quarto.yml _site_source/ 36 | 37 | # Define repo URL for link fixing 38 | REPO_URL="https://github.com/quarto-dev/quarto-actions" 39 | 40 | # Function to fix links in a README 41 | fix_readme_links() { 42 | local file=$1 43 | # First: Fix known action page links to point to site pages 44 | sed -i \ 45 | -e 's|\](./setup)|\](setup.qmd)|g' \ 46 | -e 's|\](./render)|\](render.qmd)|g' \ 47 | -e 's|\](./publish)|\](publish.qmd)|g' \ 48 | -e 's|\](./examples)|\](examples.qmd)|g' \ 49 | "$file" 50 | # Second: All remaining ./ links point to GitHub 51 | sed -i "s|\](./|\](${REPO_URL}/tree/main/|g" "$file" 52 | } 53 | 54 | # Copy and fix main README 55 | cp README.md _site_source/ 56 | fix_readme_links _site_source/README.md 57 | 58 | # Copy and fix action READMEs 59 | cp setup/README.md _site_source/setup-readme.md 60 | fix_readme_links _site_source/setup-readme.md 61 | 62 | cp render/README.md _site_source/render-readme.md 63 | fix_readme_links _site_source/render-readme.md 64 | 65 | cp publish/README.md _site_source/publish-readme.md 66 | fix_readme_links _site_source/publish-readme.md 67 | 68 | cp examples/README.md _site_source/examples-readme.md 69 | fix_readme_links _site_source/examples-readme.md 70 | 71 | # Add sidebar navigation with yq 72 | yq eval -i '.website.sidebar = [{"title": "Examples", "style": "floating", "contents": ["examples.qmd", {"section": "Workflow Examples", "contents": []}]}]' _site_source/_quarto.yml 73 | 74 | # Copy example files and add to sidebar dynamically 75 | for example in examples/example-*.md; do 76 | filename=$(basename "$example" .md) 77 | cp "$example" "_site_source/examples/${filename}.qmd" 78 | fix_readme_links "_site_source/examples/${filename}.qmd" 79 | 80 | # Add to sidebar contents 81 | yq eval -i '.website.sidebar[0].contents[1].contents += ["examples/'${filename}'.qmd"]' _site_source/_quarto.yml 82 | done 83 | 84 | # Generate index.qmd 85 | cat > _site_source/index.qmd <<'EOF' 86 | --- 87 | title: "Quarto Actions" 88 | --- 89 | 90 | This site demonstrates the quarto-actions and tests the publish action. 91 | 92 | {{< include README.md >}} 93 | EOF 94 | 95 | # Generate action pages 96 | cat > _site_source/setup.qmd <<'EOF' 97 | --- 98 | title: "Setup Action" 99 | --- 100 | 101 | {{< include setup-readme.md >}} 102 | EOF 103 | 104 | cat > _site_source/render.qmd <<'EOF' 105 | --- 106 | title: "Render Action" 107 | --- 108 | 109 | {{< include render-readme.md >}} 110 | EOF 111 | 112 | cat > _site_source/publish.qmd <<'EOF' 113 | --- 114 | title: "Publish Action" 115 | --- 116 | 117 | {{< include publish-readme.md >}} 118 | EOF 119 | 120 | cat > _site_source/examples.qmd <<'EOF' 121 | --- 122 | title: "Examples" 123 | --- 124 | 125 | {{< include examples-readme.md >}} 126 | EOF 127 | 128 | # Test the publish action 129 | - uses: ./publish 130 | with: 131 | target: gh-pages 132 | path: _site_source 133 | env: 134 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 135 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | codeofconduct@rstudio.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /setup/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Setup Quarto' 2 | author: 'Christophe Dervieux' 3 | description: 'This action will setup Quarto from the git repository https://github.com/quarto-dev/quarto-cli/' 4 | inputs: 5 | version: 6 | description: 'The version of Quarto to use. Either a release tag without "v" prefix (e.g., "0.9.486"), "pre-release" for latest built dev version, or "release", for the latest stable version.' 7 | required: false 8 | default: 'release' 9 | tinytex: 10 | description: 'If true, install TinyTex, required for PDF rendering' 11 | required: false 12 | default: 'false' 13 | outputs: 14 | version: 15 | description: 'The installed version of quarto.' 16 | runs: 17 | using: 'composite' 18 | steps: 19 | - name: 'Choose which binary to use' 20 | run: | 21 | # Select correct bundle for OS type 22 | case $RUNNER_OS in 23 | "Linux") 24 | case $RUNNER_ARCH in 25 | ARM64|ARM) 26 | echo "BUNDLE_EXT=linux-arm64.deb" >> $GITHUB_ENV 27 | ;; 28 | *) 29 | echo "BUNDLE_EXT=linux-amd64.deb" >> $GITHUB_ENV 30 | ;; 31 | esac 32 | ;; 33 | "macOS") 34 | echo "BUNDLE_EXT=macos.pkg" >> $GITHUB_ENV 35 | ;; 36 | "Windows") 37 | echo "BUNDLE_EXT=win.msi" >> $GITHUB_ENV 38 | ;; 39 | *) 40 | echo "$RUNNER_OS not supported" 41 | exit 1 42 | ;; 43 | esac 44 | shell: bash 45 | working-directory: ${{ runner.temp }} 46 | - name: 'Download Quarto' 47 | id: download-quarto 48 | env: 49 | GITHUB_TOKEN: ${{ github.token }} 50 | run: | 51 | if [ ${{ runner.os }} != "Windows" ]; then 52 | # On Windows scoop will be used so no need to download the release 53 | if [ "${{inputs.version}}" == "release" ]; then 54 | # download the latest stable release 55 | version=$(curl https://quarto.org/docs/download/_download.json | jq -r '.version') 56 | wget https://github.com/quarto-dev/quarto-cli/releases/download/v$version/quarto-$version-${{env.BUNDLE_EXT}} 57 | echo "version=${version}" >> $GITHUB_OUTPUT 58 | elif [ "${{inputs.version}}" == "LATEST" -o "${{inputs.version}}" == "pre-release" ]; then 59 | # get latest pre release version 60 | version=$(curl https://quarto.org/docs/download/_prerelease.json | jq -r '.version') 61 | wget https://github.com/quarto-dev/quarto-cli/releases/download/v$version/quarto-$version-${{env.BUNDLE_EXT}} 62 | echo "version=${version}" >> $GITHUB_OUTPUT 63 | else 64 | # download a specific release 65 | wget https://github.com/quarto-dev/quarto-cli/releases/download/v${{inputs.version}}/quarto-${{inputs.version}}-${{env.BUNDLE_EXT}} 66 | echo "version=${{inputs.version}}" >> $GITHUB_OUTPUT 67 | fi 68 | echo "installer=$(ls quarto*${{ env.BUNDLE_EXT }})" >> $GITHUB_OUTPUT 69 | else 70 | : # do nothing for now (https://github.com/quarto-dev/quarto-actions/issues/59 :facepalm:) 71 | # FIXME: how to get version information from scoop in windows runners? 72 | # send the cderv bat-signal! 73 | fi 74 | shell: bash 75 | working-directory: ${{ runner.temp }} 76 | - name: 'Install Quarto' 77 | run: | 78 | # Install quarto 79 | [ ${{ runner.os }} != "Windows" ] && installer=${{ steps.download-quarto.outputs.installer }} 80 | case $RUNNER_OS in 81 | "Linux") 82 | sudo apt -y install ./$installer 83 | ;; 84 | "macOS") 85 | sudo installer -pkg ./$installer -target '/' 86 | ;; 87 | "Windows") 88 | # can't install msi for now so use scoop 89 | if [ "${{inputs.version}}" == "release" ] 90 | then 91 | powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 92 | else 93 | powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 ${{ inputs.version }} 94 | fi 95 | ;; 96 | *) 97 | echo "$RUNNER_OS not supported" 98 | exit 1 99 | ;; 100 | esac 101 | if [ "${{ runner.os }}" != "Windows" ]; then 102 | rm $installer 103 | fi 104 | shell: bash 105 | working-directory: ${{ runner.temp }} 106 | - name: 'Verify Quarto installation' 107 | run: | 108 | if ! command -v quarto &> /dev/null; then 109 | echo "ERROR: Quarto installation completed but quarto command not found" 110 | exit 1 111 | fi 112 | echo "Quarto Installed !" 113 | quarto --version 114 | shell: bash 115 | - name: 'Install TinyTeX' 116 | env: 117 | QUARTO_PRINT_STACK: true 118 | if: ${{ inputs.tinytex == 'true'}} 119 | run: | 120 | quarto install tool tinytex --no-prompt --log-level warning 121 | case $RUNNER_OS in 122 | "Linux") 123 | echo "$HOME/bin" >> $GITHUB_PATH 124 | ;; 125 | "macOS") 126 | echo "$(dirname $(find ~/Library/TinyTeX -name tlmgr))" >> $GITHUB_PATH 127 | ;; 128 | "Windows") 129 | echo "$(dirname $(find $APPDATA/TinyTeX -name tlmgr.bat))" >> $GITHUB_PATH 130 | ;; 131 | *) 132 | echo "$RUNNER_OS not supported" 133 | exit 1 134 | ;; 135 | esac 136 | echo "TinyTeX installed !" 137 | shell: bash 138 | working-directory: ${{ runner.temp }} 139 | -------------------------------------------------------------------------------- /publish/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Publishing with Quarto using GitHub Actions 3 | 4 | This README complements the more detailed documentation on [Quarto's website](https://quarto.org/docs/publishing/). 5 | 6 | ## Netlify 7 | 8 | > See also about Netlify publishing support in Quarto. 9 | 10 | 1. Create Netlify auth token. Go to Netlify's [applications page](https://app.netlify.com/user/applications), and click on "New Access Token" to create a new personal access token. 11 | Give this token a memorable name, and note the resulting string (or keep this window open in a tab) 12 | 13 | 2. Add Netlify auth token to your repository's secrets. Go to the repository that will be using this GHA. Click on "Settings". On the new page, click on "Secrets", then on the dropdown "Actions". Now, on the right-hand tab, click on the "New repository secret" button to the right of the title "Actions secrets". For the "Name" field, use `NETLIFY_AUTH_TOKEN`, and for the "Value" field, paste the string you got from step 1. 14 | 15 | 3. Add the GitHub Actions workflow to your project. (Use [quarto-publish-example.yml](../examples/quarto-publish-example.yml) as an example). 16 | 17 | 4. Add `_publish.yml` to your repository. Quarto stores publishing metadata information in `_publish.yml`. To create this file, run `quarto publish netlify` locally once. 18 | 19 | 5. Configure action to use netlify: 20 | 21 | ```yaml 22 | - name: Publish to Netlify (and render) 23 | uses: quarto-dev/quarto-actions/publish@v2 24 | with: 25 | target: netlify 26 | NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} 27 | ``` 28 | 29 | ## GitHub Pages 30 | 31 | > See also about Github Pages publishing support in Quarto. 32 | > And about using Github Actions to publish to Github Pages with Quarto. 33 | 34 | **Note**: This action is compatible with `actions/checkout@v6` and later. If you experience credential errors when publishing to gh-pages (e.g., "fatal: could not read Username"), ensure you're using `actions/checkout@v6` or later, or pin to `actions/checkout@v5` until you can upgrade. See [#133](https://github.com/quarto-dev/quarto-actions/issues/133) for details. 35 | 36 | 1. Quarto needs to configure the repository for publishing through GitHub Actions. To do this, run `quarto publish gh-pages` locally, once. This will create a new branch called `gh-pages` and push it to the remote repository, and configure the gh-pages branch to be the [publishing source for GitHub Pages](https://quarto.org/docs/publishing/github-pages.html#source-branch). 37 | 38 | 2. Then you need to configure your repo to use Github Actions to publish, by adding GitHub Actions workflow to your project. 39 | - Use [quarto-publish-example.yml](../examples/quarto-publish-example.yml) as an example 40 | - Go over our documentation for additional details at 41 | 42 | ### Details on how to configure the GitHub Actions workflow 43 | 44 | When using `quarto-dev/quarto-actions/publish`, configure it to use `gh-pages` as publishing target: 45 | 46 | ```yaml 47 | - name: Publish to GitHub Pages (and render) 48 | uses: quarto-dev/quarto-actions/publish@v2 49 | with: 50 | target: gh-pages 51 | env: 52 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # this secret is always available for github actions 53 | ``` 54 | 55 | If you not using [quarto-publish-example.yml](../examples/quarto-publish-example.yml), check the minimum required access for the `publish` action: You need to set `contents` permissions to `write`. 56 | 57 | ```yaml 58 | permissions: 59 | contents: write 60 | ``` 61 | 62 | See Github's documentation on `permissions` for more details 63 | - Setting permissions for a workflow: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions 64 | - Setting permissions for a workflow job: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions 65 | - About `GITHUB_TOKEN` permissions: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token 66 | 67 | 68 | ## Posit Connect 69 | 70 | > See also about Posit Connect publishing support in Quarto. 71 | 72 | 1. Create Posit Connect auth token. After logging in to your Posit Connect server, click on your username on the top right. A sidebar should slide in from the right. Click on "API keys". On the new page, click on the "New API Key" button. Give it a memorable name and note the resulting string (or keep this browser window open). 73 | 74 | 2. Add Posit Connect auth token to your GitHub repository. Go to the GitHub webpage for the repository that will be using this GitHub Action. Click on "Settings". On the new page, click on "Secrets", then on the dropdown "Actions". Now, on the right-hand tab, click on the "New repository secret" button to the right of the title "Actions secrets". For the "Name" field, use `CONNECT_API_KEY`, and for the "Value" field, paste the string you got from step 1. 75 | 76 | 3. Add the GitHub Actions workflow to your project. (Use [quarto-publish-example.yml](../examples/quarto-publish-example.yml) as an example). 77 | 78 | 4. Add `_publish.yml` to your repository. Quarto stores publishing metadata information in `_publish.yml`. To create this file, run `quarto publish connect` locally once. 79 | 80 | 5. Configure action to use Posit Connect: 81 | 82 | ```yaml 83 | - name: Publish to Posit Connect (and render) 84 | uses: quarto-dev/quarto-actions/publish@v2 85 | with: 86 | target: connect 87 | CONNECT_SERVER: enter-your-server-url-here 88 | CONNECT_API_KEY: ${{ secrets.CONNECT_API_KEY }} 89 | ``` 90 | 91 | ## Other configurations available for Quarto Publish action 92 | 93 | The `with` parameter can also be set to configure the following 94 | 95 | * `path`: Subdirectory containing the quarto project to be published or path to individual .qmd file. Default to working directory (`.`) 96 | * `render`: Set to `render: "false"` to skip rendering of project before publishing. By default, this `publish` action will render to all formats defined. 97 | 98 | ## Rendering with a Quarto profile 99 | 100 | `quarto publish` will render first by default. You can render with a specific profile by setting the `QUARTO_PROFILE` environment variable. For example, to publish the version correspondig with the `preview` profile of your website (i.e. you have a `_quarto-preview.yml` file in your project), you can do: 101 | 102 | ```yaml 103 | - name: Render Quarto Project 104 | uses: quarto-dev/quarto-actions/publish@v2 105 | env: 106 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # this secret is always available for github actions 107 | QUARTO_PROFILE: preview 108 | with: 109 | target: gh-pages 110 | ``` 111 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------