A GitHub Action to install Coursier and use it to install Java and Scala CLI tools.
It can be useful if you want to install a specific version of JVM or use a build tool like mill or seed.
Inspired by olafurpg/setup-scala and the blog post Single command Scala setup by Alex Archambault (author of Coursier).
jvm (optional): JVM to install
cs java --available.jvm-index (optional): The JVM index source
cs java --available --jvm-index https://url/of/your/index.json.apps (optional): Scala apps to install (sbtn by default)
version (optional): Coursier version to install
2.1.25-M26 (defaults to a recent release when left empty)nightly installs the latest nightly buildcustomRepositories (optional): ''
disableDefaultRepos (optional): 'false'
mirrors (optional): ''
from=to entries written to ~/.config/coursier/mirror.properties before any cs invocation.from side may be a comma-separated list of source URLs.customRepositories / disableDefaultRepos, mirrors are applied at the resolver level to every repository coursier sees — including ones declared inside app descriptors that customRepositories cannot override.extraJvmArgs (optional): ''
-D JVM property args passed to every cs invocation. The -J prefix is added automatically if missing.-Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=8080launcher (optional): Coursier launcher
cs-aarch64-pc-win32-jvm.zip), which embeds its own runtime.thin (or jvm) selects the thin JVM launcher and assembly selects the assembly (fat JAR) launcher. These require Java to be installed beforehand.container, compat, and static; for example, container downloads the launcher whose filename ends in -container.preferredLauncher (optional): Preferred Coursier launcher flavor
launcher, but falls back to the default launcher with a warning when the flavored download returns a 4xx HTTP response.thin, jvm, and assembly are rejected; pass those via launcher.launcher.useContainerImage (optional): Deprecated alias for launcher: container.
steps:
- uses: actions/checkout@v4
- uses: coursier/setup-action@v3
with:
jvm: adopt:11
jvm-index: https://url/of/your/index.json
apps: sbtn bloop ammonite
disableDefaultRepos: true
customRepositories: https://packages.corp.com/maven
mirrors: |
https://repo1.maven.org/maven2=https://packages.corp.com/maven
steps:
- uses: actions/checkout@v4
- uses: coursier/setup-action@v3
with:
version: nightly
cs-version: version of the installed Coursier (should be the latest available)This action should work well with the official Coursier cache-action. For example:
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v8
- uses: coursier/setup-action@v3
TypeScript
84.7%
JavaScript
15.3%
A GitHub Action to install Coursier and use it to install Java and Scala CLI tools.
It can be useful if you want to install a specific version of JVM or use a build tool like mill or seed.
Inspired by olafurpg/setup-scala and the blog post Single command Scala setup by Alex Archambault (author of Coursier).
jvm (optional): JVM to install
cs java --available.jvm-index (optional): The JVM index source
cs java --available --jvm-index https://url/of/your/index.json.apps (optional): Scala apps to install (sbtn by default)
version (optional): Coursier version to install
2.1.25-M26 (defaults to a recent release when left empty)nightly installs the latest nightly buildcustomRepositories (optional): ''
disableDefaultRepos (optional): 'false'
mirrors (optional): ''
from=to entries written to ~/.config/coursier/mirror.properties before any cs invocation.from side may be a comma-separated list of source URLs.customRepositories / disableDefaultRepos, mirrors are applied at the resolver level to every repository coursier sees — including ones declared inside app descriptors that customRepositories cannot override.extraJvmArgs (optional): ''
-D JVM property args passed to every cs invocation. The -J prefix is added automatically if missing.-Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=8080launcher (optional): Coursier launcher
cs-aarch64-pc-win32-jvm.zip), which embeds its own runtime.thin (or jvm) selects the thin JVM launcher and assembly selects the assembly (fat JAR) launcher. These require Java to be installed beforehand.container, compat, and static; for example, container downloads the launcher whose filename ends in -container.preferredLauncher (optional): Preferred Coursier launcher flavor
launcher, but falls back to the default launcher with a warning when the flavored download returns a 4xx HTTP response.thin, jvm, and assembly are rejected; pass those via launcher.launcher.useContainerImage (optional): Deprecated alias for launcher: container.
steps:
- uses: actions/checkout@v4
- uses: coursier/setup-action@v3
with:
jvm: adopt:11
jvm-index: https://url/of/your/index.json
apps: sbtn bloop ammonite
disableDefaultRepos: true
customRepositories: https://packages.corp.com/maven
mirrors: |
https://repo1.maven.org/maven2=https://packages.corp.com/maven
steps:
- uses: actions/checkout@v4
- uses: coursier/setup-action@v3
with:
version: nightly
cs-version: version of the installed Coursier (should be the latest available)This action should work well with the official Coursier cache-action. For example:
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v8
- uses: coursier/setup-action@v3
TypeScript
84.7%
JavaScript
15.3%