XUtils

setup-dlang

Install D compilers & DUB inside GitHub Actions


Input to this action

Examples:

- uses: dlang-community/setup-dlang@v2
  with:
    compiler: dmd^3
    dub: 1.37.0
- uses: dlang-community/setup-dlang@v2
  with:
    compiler: gdmd-12
    # dub doesn't come with gdc
    dub: latest
    # Install gdmd from https://github.com/D-Programming-GDC/gdmd/blob/0a64b92ec5ad1177988496df4f3ca47c47580501/dmd-script
    gdmd_sha: '0a64b92ec5ad1177988496df4f3ca47c47580501'

dub

If you need a specific version of dub or if the D compiler doesn’t come with one (gdc) you can explicitly install one.

You can specify this version as:

gh_token

A github token used to perform queries to https://api.github.com. Check the compiler input for when this token is used. Github generates a token for each workflow run and this action will use that by default.

gdmd_sha

In case the gdmd script in the ubuntu repositories is too old you can specify a commit sha in https://github.com/D-Programming-GDC/gdmd and this action will use that to download a git version of the script.

GDC

Gdc is currently only available on linux. The exact versions available are those in the ubuntu repos. Note that gdc won’t come by default with any extra programs like rdmd or dub so you would need to install them separately or install another compiler that comes with them. You can do that with:

- uses: dlang-community/setup-dlang@v2
  name: Install dub and tools
  with:
    compiler: dmd

- uses: dlang-community/setup-dlang@v2
  name: Install D compiler
  with:
    compiler: gdc-12

  # Now you have dub, rdmd and gdc-12 in $PATH and $DC point to gdc-12

Changes from v1

The most important change is the $DC environment variable becoming an absolute path instead of only the filename. Depending on how it is used in scripts care must be taken to properly quote it especially on windows to avoid the \ character being lost.

DMD versions prior to dmd-2.072 will no longer install dub automatically. If you need dub with these versions just specify it as an argument to the action.

When specifying dmd-beta the action may install dmd-latest if it determines that it has a more recent version. Example, if the latest DMD beta is 2.098.1_rc1 and the latest DMD release is 2.099.0 then dmd-beta will now resolve to 2.099.0 instead of 2.098.1_rc1.

The minimum available version of dmd has been raised to 2.065.0.


Articles

  • coming soon...