Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scala-cli-setup after release #1019

Merged
merged 1 commit into from
May 19, 2022
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
4 changes: 4 additions & 0 deletions .github/release/release-procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- [ ] Update the supported scala versions for the new release in the docs:
- [ ] Scala: [scala-cli-scala-versions.md](https://github.com/VirtusLab/scala-cli/blob/main/website/docs/reference/scala-versions.md)
- [ ] Scala.js: [scala-js.md](https://github.com/VirtusLab/scala-cli/blob/main/website/docs/guides/scala-js.md#supported-scalajs-versions)
- [ ] ScalaCLI Setup
- [ ] Merge pull request with updated ScalaCLI version in [scala-cli-setup](https://github.com/VirtusLab/scala-cli-setup) repository. Pull request should be opened automatically after release.
- [ ] Make a release with the updated ScalaCLI version.
- [ ] Update v0.1 tag to the newest tag.
- [ ] Mark the release draft as `pre-release` and then `Publish Release`
- [ ] Wait for a green release CI build with all the updated versions.
- [ ] Unmark release as `pre-release`.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,4 @@ jobs:
env:
SDKMAN_KEY: ${{ secrets.SDKMAN_KEY }}
SDKMAN_TOKEN: ${{ secrets.SDKMAN_TOKEN }}
- run: ./mill -i ci.updateScalaCliSetup
29 changes: 29 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,35 @@ object ci extends Module {
def publishVersion() = T.command {
println(cli.publishVersion())
}
def updateScalaCliSetup() = T.command {
val version = cli.publishVersion()

val targetDir = os.pwd / "target"
val mainDir = targetDir / "scala-cli-setup"
val setupScriptPath = mainDir / "src" / "main.ts"

// clean target directory
if (os.exists(targetDir)) os.remove.all(targetDir)

os.makeDir.all(targetDir)

val branch = "main"
val targetBranch = s"update-scala-cli-setup"
val repo = "git@github.com:VirtusLab/scala-cli-setup.git"

// Cloning
gitClone(repo, branch, targetDir)
setupGithubRepo(mainDir)

val setupScript = os.read(setupScriptPath)
val scalaCliVersionRegex = "const scalaCLIVersion = '.*'".r
val updatedSetupScriptPath =
scalaCliVersionRegex.replaceFirstIn(setupScript, s"const scalaCLIVersion = '$version'")
os.write.over(setupScriptPath, updatedSetupScriptPath)

os.proc("git", "switch", "-c", targetBranch).call(cwd = mainDir)
commitChanges(s"Update scala-cli version to $version", targetBranch, mainDir)
}
def updateStandaloneLauncher() = T.command {
val version = cli.publishVersion()

Expand Down