Skip to content

Commit

Permalink
first trial to build the msi
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaremmal committed Jun 13, 2024
1 parent ae7a49c commit 88a77b7
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/build-msi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

name: Build the MSI Package

on:
push:

jobs:
build:
runs-on: windows-latest
env:
RELEASEBUILD: yes
steps:
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: 'sbt'
- name: Build MSI package
run: |
sbt 'dist-win-x86_64/Windows/packageBin'
- name: Upload MSI Artifact
uses: actions/upload-artifact@v3
with:
name: scala.msi
path: ./dist/win-x86_64/target/windows/
4 changes: 3 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ object Build {

val referenceVersion = "3.4.2-RC1"

val baseVersion = "3.5.1-RC1"
val baseVersion = "3.5.1"

// LTS or Next
val versionLine = "Next"
Expand Down Expand Up @@ -2181,7 +2181,9 @@ object Build {
Universal / mappings += (republishRepo.value / "etc" / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"),
)
.settings(
Windows / name := "scala",
Windows / mappings := (Universal / mappings).value,
Windows / packageBin := (Windows / packageBin).dependsOn(republish).value,
maintainer := "Josh Suereth <joshua.suereth@typesafe.com>",
packageSummary := "test-windows",
packageDescription := """Test Windows MSI.""",
Expand Down
50 changes: 50 additions & 0 deletions project/DistributionPlugin.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import com.typesafe.sbt.packager.Keys.stage
import com.typesafe.sbt.packager.universal.UniversalPlugin
import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport.Universal
import sbt.*

/**
* @author Hamza REMMAL (https://github.com/hamzaremmal/)
*/
object DistributionPlugin extends AutoPlugin {

override def trigger = allRequirements

override def requires =
super.requires && UniversalPlugin // Require the Universal Plugin to

object autoImport {
val `universal_project` = settingKey[Project]("???")
val `linux-aarch64_project` = settingKey[Project]("???")
val `linux-x86_64_project` = settingKey[Project]("???")
val `mac-aarch64_project` = settingKey[Project]("???")
val `win-x86_64_project` = settingKey[Project]("???")


// ========================== TASKS TO GENERATE THE FOLDER PACKAGE ============================
val `pack-universal` =
taskKey[File]("Generate the package with the universal binaries (folder)")
val `pack_linux-aarch64` =
taskKey[File]("Generate the package with the linux-aarch64 binaries (folder)")
val `pack_linux-x86_64` =
taskKey[File]("Generate the package with the linux-x86_64 binaries (folder)")
val `pack_mac-aarch64` =
taskKey[File]("Generate the package with the mac-aarch64 binaries (folder)")
val `pack_mac-x86_64` =
taskKey[File]("Generate the package with the mac-x86_64 binaries (folder)")
val `pack_win-x86_64` =
taskKey[File]("Generate the package with the linux-x86_64 binaries (folder)")
}

import autoImport.*

override def projectSettings = Def.settings(
`pack-universal` := (`universal_project` / Universal./(stage)).value ,
`pack_linux-aarch64` := ???,
`pack_linux-x86_64` := ???,
`pack_mac-aarch64` := ???,
`pack_mac-x86_64` := ???,
`pack_win-x86_64` := ???
)

}

0 comments on commit 88a77b7

Please sign in to comment.