Skip to content

Commit 622d1fc

Browse files
authored
Merge pull request #346 from VirtusLab/update-installation-script
Update installation script in react of release scala-cli
2 parents 8b76d96 + 2af4014 commit 622d1fc

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ jobs:
317317
ssh-private-key: |
318318
${{ secrets.SCALA_CLI_PACKAGES_KEY }}
319319
${{ secrets.HOMEBREW_SCALA_CLI_KEY }}
320+
- run: ./mill -i ci.updateInstallationScript
320321
- run: ./mill -i ci.updateBrewFormula
321322
- name: GPG setup
322323
run: .github/scripts/gpg-setup.sh

build.sc

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ object ci extends Module {
710710
val launcherScript = os.read(standaloneLauncherPath)
711711
val scalaCliVersionRegex = "SCALA_CLI_VERSION=\".*\"".r
712712
val updatedLauncherScript =
713-
scalaCliVersionRegex.replaceFirstIn(launcherScript, s"SCALA_CLI_VERSION=$version")
713+
scalaCliVersionRegex.replaceFirstIn(launcherScript, s"""SCALA_CLI_VERSION="$version"""")
714714
os.write.over(standaloneLauncherPath, updatedLauncherScript)
715715

716716
val launcherWindowsScript = os.read(standaloneWindowsLauncherPath)
@@ -771,6 +771,33 @@ object ci extends Module {
771771

772772
commitChanges(s"Update for $version", branch, homebrewFormulaDir)
773773
}
774+
def updateInstallationScript() = T.command {
775+
val version = cli.publishVersion()
776+
777+
val targetDir = os.pwd / "target"
778+
val packagesDir = targetDir / "scala-cli-packages"
779+
val installationScriptPath = packagesDir / "scala-setup.sh"
780+
781+
// clean target directory
782+
if (os.exists(targetDir)) os.remove.all(targetDir)
783+
784+
os.makeDir.all(targetDir)
785+
786+
val branch = "master"
787+
val repo = s"[email protected]:Virtuslab/scala-cli-packages.git"
788+
789+
// Cloning
790+
gitClone(repo, branch, targetDir)
791+
setupGithubRepo(packagesDir)
792+
793+
val installationScript = os.read(installationScriptPath)
794+
val scalaCliVersionRegex = "SCALA_CLI_VERSION=\".*\"".r
795+
val updatedInstallationScript =
796+
scalaCliVersionRegex.replaceFirstIn(installationScript, s"""SCALA_CLI_VERSION="$version"""")
797+
os.write.over(installationScriptPath, updatedInstallationScript)
798+
799+
commitChanges(s"Update installation script for $version", branch, packagesDir)
800+
}
774801
def updateDebianPackages() = T.command {
775802
val version = cli.publishVersion()
776803

scala-cli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
set -eu
99

10-
SCALA_CLI_VERSION=0.0.7
10+
SCALA_CLI_VERSION="0.0.7"
1111

1212
if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" == "Linux" ]; then
1313
SCALA_CLI_URL="https://github.com/VirtusLab/scala-cli/releases/download/v$SCALA_CLI_VERSION/scala-cli-x86_64-pc-linux.gz"

0 commit comments

Comments
 (0)