Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,33 @@ object ci extends Module {
)
.call(cwd = debianDir, stdin = pgpPassphrase, stdout = inReleasePath)

// Export the public key as a binary (non-armored) keyring at the repo root so that
// users can reference it via `signed-by` in their APT sources.
// Binary format is required per https://wiki.debian.org/DebianRepository/UseThirdParty
val keyringPath = packagesDir / "scala-cli-archive-keyring.gpg"
Comment thread
tgodzik marked this conversation as resolved.
os.proc("gpg", "--batch", "--yes", "--export", keyName)
.call(stdout = keyringPath)

// Update the .list file to include the signed-by option pointing at the keyring.
// This scopes the key to this repository only, preventing the globally-trusted key
// security issue described in the Debian wiki.
os.write.over(
debianDir / "scala_cli_packages.list",
"deb [signed-by=/etc/apt/keyrings/scala-cli-archive-keyring.gpg] https://virtuslab.github.io/scala-cli-packages/debian ./\n"
)

// Also provide a DEB822 .sources file for users on modern Debian (apt modernize-sources).
// No Components field: this is a flat repository (Suites: ./).
// No Architectures field: avoids breaking when aarch64 packages are added later.
os.write.over(
debianDir / "scala_cli_packages.sources",
"""Types: deb
|URIs: https://virtuslab.github.io/scala-cli-packages/debian
|Suites: ./
|Signed-By: /etc/apt/keyrings/scala-cli-archive-keyring.gpg
|""".stripMargin
)

commitChanges(s"Update Debian packages for $version", branch, packagesDir)
}
def updateChocolateyPackage(): Command[os.CommandResult] = Task.Command {
Expand Down
3 changes: 2 additions & 1 deletion website/docs/_advanced_install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ scala-cli version
Scala CLI can be installed via [apt](https://wiki.debian.org/Apt) packager tool.

```bash
curl -sS "https://virtuslab.github.io/scala-cli-packages/KEY.gpg" | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/scala-cli.gpg 2>/dev/null
sudo mkdir -p /etc/apt/keyrings
curl -sS "https://virtuslab.github.io/scala-cli-packages/scala-cli-archive-keyring.gpg" | sudo tee /etc/apt/keyrings/scala-cli-archive-keyring.gpg > /dev/null
Comment thread
Gedochao marked this conversation as resolved.
sudo curl -s --compressed -o /etc/apt/sources.list.d/scala_cli_packages.list "https://virtuslab.github.io/scala-cli-packages/debian/scala_cli_packages.list"
sudo apt update
sudo apt install scala-cli
Expand Down
Loading